Packages

package cache

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. Protected

Type Members

  1. class AhcHttpCache extends CacheDefaults with Debug

    Central HTTP cache.

    Central HTTP cache. This keeps a cache of HTTP responses according to https://tools.ietf.org/html/rfc7234#section-2

    The primary cache key consists of the request method and target URI. However, since HTTP caches in common use today are typically limited to caching responses to GET, many caches simply decline other methods and use only the URI as the primary cache key.

  2. class AsyncCacheableConnection[T] extends Callable[T] with Debug

    Calls the relevant methods on the async handler, providing it with the cached response.

  3. class AsyncCachingHandler[T] extends AsyncHandler[T] with TimeoutResponse with Debug

    An async handler that accumulates response data to place in cache with the given key.

  4. class BackgroundAsyncHandler[T] extends AsyncHandler[T] with Debug

    An async handler that accumulates a response and stores it to cache in the background.

  5. trait Cache extends AnyRef

    A very simple cache trait.

    A very simple cache trait.

    Implementations can write adapters that map through to this trait, i.e.

    import java.util.concurrent.TimeUnit
    import scala.concurrent.Future
    
    import com.github.benmanes.caffeine.cache.{ Caffeine, Ticker }
    
    import play.api.libs.ws.ahc.cache.{
      Cache, EffectiveURIKey, ResponseEntry
    }
    
    class CaffeineHttpCache extends Cache {
      val underlying = Caffeine.newBuilder()
        .ticker(Ticker.systemTicker())
        .expireAfterWrite(365, TimeUnit.DAYS)
        .build[EffectiveURIKey, ResponseEntry]()
    
      def remove(key: EffectiveURIKey) =
        Future.successful(Option(underlying.invalidate(key)))
    
      def put(key: EffectiveURIKey, entry: ResponseEntry) =
        Future.successful(underlying.put(key, entry))
    
      def get(key: EffectiveURIKey) =
        Future.successful(Option(underlying getIfPresent key ))
    
      def close(): Unit = underlying.cleanUp()
    }
  6. class CacheFuture[T] extends ListenableFuture[T]

    A wrapper to return a ListenableFuture.

  7. class CacheableHttpResponseBodyPart extends HttpResponseBodyPart
  8. class CacheableHttpResponseStatus extends HttpResponseStatus
  9. case class CacheableResponse(status: CacheableHttpResponseStatus, headers: HttpHeaders, bodyParts: List[CacheableHttpResponseBodyPart], ahcConfig: AsyncHttpClientConfig) extends Response with Product with Serializable
  10. class CacheableResponseBuilder extends AnyRef
  11. class CachingAsyncHttpClient extends AsyncHttpClient with TimeoutResponse with Debug

    A provider that pulls a response from the cache.

  12. case class EffectiveURIKey(method: String, uri: URI) extends Product with Serializable
  13. case class ResponseEntry(response: CacheableResponse, requestMethod: String, nominatedHeaders: Map[HeaderName, Seq[String]], expiresAt: Option[ZonedDateTime]) extends Product with Serializable

    A cache entry with an optional expiry time

  14. trait TimeoutResponse extends AnyRef

Ungrouped