Package

play.api.libs.ws.ahc

cache

Permalink

package cache

Visibility
  1. Public
  2. All

Type Members

  1. class AhcHttpCache extends CacheDefaults with Debug

    Permalink

    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

    Permalink

    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

    Permalink

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

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

    Permalink

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

  5. trait Cache extends AnyRef

    Permalink

    A very simple cache trait.

    A very simple cache trait.

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

    class CaffeineHttpCache extends Cache {
       val underlying = Caffeine.newBuilder()
         .ticker(Ticker.systemTicker())
         .expireAfterWrite(365, TimeUnit.DAYS)
         .build[EffectiveURIKey, ResponseEntry]()
    
        override def remove(key: EffectiveURIKey) = Future.successful(Option(underlying.invalidate(key))
        override def put(key: EffectiveURIKey, entry: ResponseEntry) = Future.successful(underlying.put(key, entry))
        override def get(key: EffectiveURIKey) = Future.successful(underlying.getIfPresent(key))
        override def close(): Unit = underlying.cleanUp()
    }
  6. class CacheFuture[T] extends ListenableFuture[T]

    Permalink

    A wrapper to return a ListenableFuture.

  7. class CacheableHttpResponseBodyPart extends HttpResponseBodyPart

    Permalink
  8. case class CacheableHttpResponseHeaders(trailingHeaders: Boolean, headers: HttpHeaders) extends HttpResponseHeaders with Product with Serializable

    Permalink
  9. class CacheableHttpResponseStatus extends HttpResponseStatus

    Permalink
  10. case class CacheableResponse(status: CacheableHttpResponseStatus, headers: CacheableHttpResponseHeaders, bodyParts: List[CacheableHttpResponseBodyPart]) extends Response with Product with Serializable

    Permalink
  11. class CacheableResponseBuilder extends AnyRef

    Permalink
  12. class CachingAsyncHttpClient extends AsyncHttpClient with TimeoutResponse with Debug

    Permalink

    A provider that pulls a response from the cache.

  13. case class EffectiveURIKey(method: String, uri: URI) extends Product with Serializable

    Permalink
  14. case class ResponseEntry(response: CacheableResponse, requestMethod: String, nominatedHeaders: Map[HeaderName, Seq[String]], expiresAt: Option[DateTime]) extends Product with Serializable

    Permalink

    A cache entry with an optional expiry time

  15. trait TimeoutResponse extends AnyRef

    Permalink

Value Members

  1. object AsyncCacheableConnection

    Permalink
  2. object AsyncCachingHandler

    Permalink
  3. object BackgroundAsyncHandler

    Permalink
  4. object CacheableResponse extends Serializable

    Permalink
  5. object EffectiveURIKey extends Serializable

    Permalink

Ungrouped