Class CachingDirectives$

java.lang.Object
akka.http.javadsl.server.directives.CachingDirectives$

public class CachingDirectives$ extends Object
  • Field Details

    • MODULE$

      public static final CachingDirectives$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • CachingDirectives$

      public CachingDirectives$()
  • Method Details

    • cache

      public <K> RouteAdapter cache(Cache<K,RouteResult> cache, scala.PartialFunction<RequestContext,K> keyer, Supplier<Route> inner)
      Wraps its inner Route with caching support using the given Cache implementation and keyer function.

      Use JavaPartialFunction to build the keyer.

      Parameters:
      cache - (undocumented)
      keyer - (undocumented)
      inner - (undocumented)
      Returns:
      (undocumented)
    • cachingProhibited

      public RouteAdapter cachingProhibited(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.
      Parameters:
      inner - (undocumented)
      Returns:
      (undocumented)
    • alwaysCache

      public <K> RouteAdapter alwaysCache(Cache<K,RouteResult> cache, scala.PartialFunction<RequestContext,K> keyer, Supplier<Route> inner)
      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)
      inner - (undocumented)
      Returns:
      (undocumented)
    • routeCache

      public <K> Cache<K,RouteResult> routeCache(CachingSettings settings)
      Creates an LfuCache

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

      Parameters:
      settings - (undocumented)
      Returns:
      (undocumented)