play.api.libs.ws.ahc.cache
Members list
Type members
Classlikes
Central HTTP cache. This keeps a cache of HTTP responses according to https://tools.ietf.org/html/rfc7234#section-2
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.
Attributes
- Supertypes
Calls the relevant methods on the async handler, providing it with the cached response.
Calls the relevant methods on the async handler, providing it with the cached response.
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
An async handler that accumulates response data to place in cache with the given key.
An async handler that accumulates response data to place in cache with the given key.
Attributes
- Companion
- object
- Supertypes
-
trait AhcUtilitiestrait TimeoutResponsetrait AsyncHandler[T]class Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
AsyncCachingHandler.type
An async handler that accumulates a response and stores it to cache in the background.
An async handler that accumulates a response and stores it to cache in the background.
Attributes
- Companion
- object
- Supertypes
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
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()
}
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
A wrapper to return a ListenableFuture.
A wrapper to return a ListenableFuture.
Attributes
- Supertypes
-
trait ListenableFuture[T]trait Future[T]class Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class HttpResponseBodyPartclass Objecttrait Matchableclass Any
Attributes
- Supertypes
-
class HttpResponseStatusclass Objecttrait Matchableclass Any
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait Responseclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
CacheableResponse.type
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
A provider that pulls a response from the cache.
A provider that pulls a response from the cache.
Attributes
- Supertypes
-
trait AhcUtilitiestrait TimeoutResponsetrait AsyncHttpClienttrait Closeabletrait AutoCloseableclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- object
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Companion
- class
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
- Self type
-
EffectiveURIKey.type
A cache entry with an optional expiry time
A cache entry with an optional expiry time
Attributes
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class AsyncCachingHandler[T]class CachingAsyncHttpClient