CachingDirectives

org.apache.pekko.http.javadsl.server.directives.CachingDirectives

Attributes

Source
CachingDirectives.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def alwaysCache[K](cache: Cache[K, RouteResult], keyer: PartialFunction[RequestContext, K], inner: Supplier[Route]): RouteAdapter

Wraps its inner Route with caching support using the given Cache implementation and keyer function. Note that routes producing streaming responses cannot be wrapped with this directive.

Wraps its inner Route with caching support using the given Cache implementation and keyer function. Note that routes producing streaming responses cannot be wrapped with this directive.

Attributes

Source
CachingDirectives.scala
def cache[K](cache: Cache[K, RouteResult], keyer: PartialFunction[RequestContext, K], inner: Supplier[Route]): RouteAdapter

Wraps its inner Route with caching support using the given pekko.http.caching.scaladsl.Cache implementation and keyer function.

Wraps its inner Route with caching support using the given pekko.http.caching.scaladsl.Cache implementation and keyer function.

Use pekko.japi.JavaPartialFunction to build the keyer.

Attributes

Source
CachingDirectives.scala

Passes only requests to the inner route that explicitly forbid caching with a Cache-Control header with either a no-cache or max-age=0 setting.

Passes only requests to the inner route that explicitly forbid caching with a Cache-Control header with either a no-cache or max-age=0 setting.

Attributes

Source
CachingDirectives.scala
def routeCache[K](settings: CachingSettings): Cache[K, RouteResult]

Creates an LfuCache

Creates an LfuCache

Default settings are available via pekko.http.caching.javadsl.CachingSettings.create.

Attributes

Source
CachingDirectives.scala