Class CachingDirectives$
- java.lang.Object
-
- akka.http.javadsl.server.directives.CachingDirectives$
-
public class CachingDirectives$ extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static CachingDirectives$MODULE$Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description CachingDirectives$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K> RouteAdapteralwaysCache(Cache<K,RouteResult> cache, scala.PartialFunction<RequestContext,K> keyer, java.util.function.Supplier<Route> inner)Wraps its inner Route with caching support using the givenCacheimplementation and keyer function.<K> RouteAdaptercache(Cache<K,RouteResult> cache, scala.PartialFunction<RequestContext,K> keyer, java.util.function.Supplier<Route> inner)Wraps its inner Route with caching support using the givenCacheimplementation and keyer function.RouteAdaptercachingProhibited(java.util.function.Supplier<Route> inner)Passes only requests to the inner route that explicitly forbid caching with aCache-Controlheader with either ano-cacheormax-age=0setting.<K> Cache<K,RouteResult>routeCache(CachingSettings settings)Creates anLfuCache
-
-
-
Field Detail
-
MODULE$
public static final CachingDirectives$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
cache
public <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 givenCacheimplementation and keyer function.Use
JavaPartialFunctionto build thekeyer.- Parameters:
cache- (undocumented)keyer- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
cachingProhibited
public RouteAdapter cachingProhibited(java.util.function.Supplier<Route> inner)
Passes only requests to the inner route that explicitly forbid caching with aCache-Controlheader with either ano-cacheormax-age=0setting.- Parameters:
inner- (undocumented)- Returns:
- (undocumented)
-
alwaysCache
public <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 givenCacheimplementation and keyer function. Note that routes producing streaming responses cannot be wrapped with this directive.- Parameters:
cache- (undocumented)keyer- (undocumented)inner- (undocumented)- Returns:
- (undocumented)
-
routeCache
public <K> Cache<K,RouteResult> routeCache(CachingSettings settings)
Creates anLfuCacheDefault settings are available via
akka.http.caching.javadsl.CachingSettings.create.- Parameters:
settings- (undocumented)- Returns:
- (undocumented)
-
-