public class CachingDirectives
extends java.lang.Object
Constructor and Description |
---|
CachingDirectives() |
Modifier and Type | Method and Description |
---|---|
static <K> RouteAdapter |
alwaysCache(Cache<K,RouteResult> cache,
scala.PartialFunction<RequestContext,K> keyer,
java.util.function.Supplier<Route> inner)
Wraps its inner Route with caching support using the given
Cache implementation and
keyer function. |
static <K> RouteAdapter |
cache(Cache<K,RouteResult> cache,
scala.PartialFunction<RequestContext,K> keyer,
java.util.function.Supplier<Route> inner)
Wraps its inner Route with caching support using the given
pekko.http.caching.scaladsl.Cache implementation and
keyer function. |
static RouteAdapter |
cachingProhibited(java.util.function.Supplier<Route> inner)
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. |
static <K> Cache<K,RouteResult> |
routeCache(CachingSettings settings)
Creates an
LfuCache
Default settings are available via pekko.http.caching.javadsl.CachingSettings.create . |
public static <K> RouteAdapter cache(Cache<K,RouteResult> cache, scala.PartialFunction<RequestContext,K> keyer, java.util.function.Supplier<Route> inner)
pekko.http.caching.scaladsl.Cache
implementation and
keyer function.
Use pekko.japi.JavaPartialFunction
to build the keyer
.
cache
- (undocumented)keyer
- (undocumented)inner
- (undocumented)public static RouteAdapter cachingProhibited(java.util.function.Supplier<Route> inner)
Cache-Control
header with either
a no-cache
or max-age=0
setting.inner
- (undocumented)public static <K> RouteAdapter alwaysCache(Cache<K,RouteResult> cache, scala.PartialFunction<RequestContext,K> keyer, java.util.function.Supplier<Route> inner)
Cache
implementation and
keyer function. Note that routes producing streaming responses cannot be wrapped with this directive.cache
- (undocumented)keyer
- (undocumented)inner
- (undocumented)public static <K> Cache<K,RouteResult> routeCache(CachingSettings settings)
LfuCache
Default settings are available via pekko.http.caching.javadsl.CachingSettings.create
.
settings
- (undocumented)