package cache
- Alphabetic
- Public
- Protected
Type Members
- 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.
- class AsyncCacheableConnection[T] extends Callable[T] with Debug
Calls the relevant methods on the async handler, providing it with the cached response.
- 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.
- class BackgroundAsyncHandler[T] extends AsyncHandler[T] with Debug
An async handler that accumulates a response and stores it to cache in the background.
- 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() }
- class CacheFuture[T] extends ListenableFuture[T]
A wrapper to return a ListenableFuture.
- class CacheableHttpResponseBodyPart extends HttpResponseBodyPart
- class CacheableHttpResponseStatus extends HttpResponseStatus
- case class CacheableResponse(status: CacheableHttpResponseStatus, headers: HttpHeaders, bodyParts: List[CacheableHttpResponseBodyPart], ahcConfig: AsyncHttpClientConfig) extends Response with Product with Serializable
- class CacheableResponseBuilder extends AnyRef
- class CachingAsyncHttpClient extends AsyncHttpClient with TimeoutResponse with Debug
A provider that pulls a response from the cache.
- case class EffectiveURIKey(method: String, uri: URI) extends Product with Serializable
- 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
- trait TimeoutResponse extends AnyRef
Value Members
- object AsyncCacheableConnection
- object AsyncCachingHandler
- object BackgroundAsyncHandler
- object CacheableResponse extends Serializable
- object EffectiveURIKey extends Serializable