Interface CachingDirectives

    • Method Detail

      • 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 given Cache 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 a Cache-Control header with either a no-cache or max-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 given Cache implementation and keyer function. Note that routes producing streaming responses cannot be wrapped with this directive.
        Parameters:
        cache - (undocumented)
        keyer - (undocumented)
        Returns:
        (undocumented)
      • routeCache

        <K> Cache<K,​RouteResult> routeCache​(akka.actor.ActorSystem s)
        Creates an LfuCache with default settings obtained from the system's configuration.
        Parameters:
        s - (undocumented)
        Returns:
        (undocumented)
      • routeCache

        <K> Cache<K,​RouteResult> routeCache​(CachingSettings settings)
        Creates an LfuCache.
        Parameters:
        settings - (undocumented)
        Returns:
        (undocumented)