Interface CachingDirectives
- All Known Implementing Classes:
CachingDirectives$
public interface CachingDirectives
-
Method Summary
Modifier and TypeMethodDescription<K> Directive<scala.runtime.BoxedUnit>
alwaysCache
(Cache<K, RouteResult> cache, scala.PartialFunction<RequestContext, K> keyer) Wraps its inner Route with caching support using the givenCache
implementation and keyer function.<K> Directive<scala.runtime.BoxedUnit>
cache
(Cache<K, RouteResult> cache, scala.PartialFunction<RequestContext, K> keyer) Wraps its inner Route with caching support using the givenCache
implementation and keyer function.Directive<scala.runtime.BoxedUnit>
Passes only requests to the inner route that explicitly forbid caching with aCache-Control
header with either ano-cache
ormax-age=0
setting.<K> Cache<K,
RouteResult> routeCache
(akka.actor.ActorSystem s) Creates anLfuCache
with default settings obtained from the system's configuration.<K> Cache<K,
RouteResult> routeCache
(CachingSettings settings) Creates anLfuCache
.
-
Method Details
-
cache
<K> Directive<scala.runtime.BoxedUnit> cache(Cache<K, RouteResult> cache, scala.PartialFunction<RequestContext, K> keyer) Wraps its inner Route with caching support using the givenCache
implementation and keyer function.- Parameters:
cache
- (undocumented)keyer
- (undocumented)- Returns:
- (undocumented)
-
cachingProhibited
Directive<scala.runtime.BoxedUnit> cachingProhibited()Passes only requests to the inner route that explicitly forbid caching with aCache-Control
header with either ano-cache
ormax-age=0
setting.- Returns:
- (undocumented)
-
alwaysCache
<K> Directive<scala.runtime.BoxedUnit> alwaysCache(Cache<K, RouteResult> cache, scala.PartialFunction<RequestContext, K> keyer) Wraps its inner Route with caching support using the givenCache
implementation and keyer function. Note that routes producing streaming responses cannot be wrapped with this directive.- Parameters:
cache
- (undocumented)keyer
- (undocumented)- Returns:
- (undocumented)
-
routeCache
Creates anLfuCache
with default settings obtained from the system's configuration.- Parameters:
s
- (undocumented)- Returns:
- (undocumented)
-
routeCache
Creates anLfuCache
.- Parameters:
settings
- (undocumented)- Returns:
- (undocumented)
-