Class/Object

play.api.libs.ws.ahc.cache

AhcHttpCache

Related Docs: object AhcHttpCache | package cache

Permalink

class AhcHttpCache extends CacheDefaults with Debug

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.

Source
AhcHttpCache.scala
Linear Supertypes
Debug, AhcUtilities, CacheDefaults, Cache, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AhcHttpCache
  2. Debug
  3. AhcUtilities
  4. CacheDefaults
  5. Cache
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AhcHttpCache(underlying: Cache[EffectiveURIKey, ResponseEntry])

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def addDisconnectHeader(response: CacheableResponse): CacheableResponse

    Permalink
  5. def addRevalidationFailed(response: CacheableResponse): CacheableResponse

    Permalink
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def cacheResponse(request: Request, response: CacheableResponse): Unit

    Permalink

    Caches the response, stripping any headers marked as "not-cacheable".

  8. def cachingAction(request: Request, response: CacheableResponse): ResponseCachingAction

    Permalink
  9. def calculateCurrentAge(request: CacheRequest, response: StoredResponse, requestTime: DateTime, responseTime: DateTime): Seconds

    Permalink

  10. def calculateCurrentAge(request: Request, entry: ResponseEntry, requestTime: DateTime): Seconds

    Permalink

  11. def calculateFreshnessFromHeuristic(request: CacheRequest, response: CacheResponse): Option[Seconds]

    Permalink

    Allows the cache to calculate the freshness lifetime of the request using a heuristic.

    Allows the cache to calculate the freshness lifetime of the request using a heuristic.

    Definition Classes
    AhcHttpCacheCache
    See also

    https://tools.ietf.org/html/rfc7234#section-4.2.2

  12. def calculateFreshnessLifetime(request: Request, entry: ResponseEntry): Seconds

    Permalink

  13. def calculateSecondaryKeys(request: Request, response: Response): Option[Map[HeaderName, Seq[String]]]

    Permalink

  14. def calculateTimeToLive(request: Request, status: CacheableHttpResponseStatus, headers: CacheableHttpResponseHeaders): Option[DateTime]

    Permalink

  15. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  16. def containsMatchingHeaders(presentedHeaders: Map[HeaderName, Seq[String]], nominatedHeaders: Map[HeaderName, Seq[String]]): Boolean

    Permalink

    Returns true if the selecting header fields nominated by the stored response match those presented by the new request.

    Returns true if the selecting header fields nominated by the stored response match those presented by the new request. This method is broken out into the cache functionality as section 4.1 can do transformation of header fields in non-trivial ways that cannot be anticipated by this library in order to find a match. Given the vagaries of Vary and the overall complexities of fields such as User-Agent, the assumption is that the cache knows best.

    presentedHeaders

    the presented headers by the new request.

    nominatedHeaders

    the header fields nominated by the stored response

    returns

    true if the cache considers it a match, false otherwise.

    Definition Classes
    CacheDefaultsCache
    See also

    https://tools.ietf.org/html/rfc7234#section-4.1

  17. def debug(bodyPart: HttpResponseBodyPart): String

    Permalink
    Definition Classes
    Debug
  18. def debug[T](ctx: FilterContext[T]): String

    Permalink
    Definition Classes
    Debug
  19. def debug[T](handler: AsyncHandler[T]): String

    Permalink
    Definition Classes
    Debug
  20. def debug(bodyParts: List[HttpResponseBodyPart]): String

    Permalink
    Definition Classes
    Debug
  21. def debug(responseHeaders: HttpResponseHeaders): String

    Permalink
    Definition Classes
    Debug
  22. def debug(responseStatus: HttpResponseStatus): String

    Permalink
    Definition Classes
    Debug
  23. def debug(response: Response): String

    Permalink
    Definition Classes
    Debug
  24. def debug(request: Request): String

    Permalink
    Definition Classes
    Debug
  25. def debug(cfg: AsyncHttpClientConfig): String

    Permalink
    Definition Classes
    Debug
  26. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  27. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  28. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. def freshenResponse(newHeaders: HttpHeaders, response: CacheableResponse): CacheableResponse

    Permalink

  30. def generateCacheRequest(request: Request): CacheRequest

    Permalink
    Attributes
    protected
  31. def generateCachedResponse(request: Request, entry: ResponseEntry, currentAge: Seconds, isFresh: Boolean): CacheableResponse

    Permalink

    Generates a response for the HTTP response with the appropriate headers.

  32. def generateOriginResponse(request: Request, status: Int, responseHeaders: HttpResponseHeaders): OriginResponse

    Permalink
    Attributes
    protected
  33. def generateStoredResponse(response: CacheableResponse, requestMethod: String, nominatedHeaders: Map[HeaderName, Seq[String]]): StoredResponse

    Permalink
    Attributes
    protected
  34. def get(key: EffectiveURIKey): Future[Option[ResponseEntry]]

    Permalink
  35. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  36. def getURI(response: CacheableResponse, headerName: String): Option[URI]

    Permalink

    Attributes
    protected
  37. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  38. def headersToMap(headers: HttpHeaders): TreeMap[String, Seq[String]]

    Permalink
    Definition Classes
    AhcUtilities
  39. def invalidateIfUnsafe(request: Request, response: CacheableResponse): Unit

    Permalink

  40. def invalidateKey(key: EffectiveURIKey): Unit

    Permalink

    Invalidates the key.

  41. def isCacheableExtension(extension: CacheDirectiveExtension): Boolean

    Permalink

    Returns true if the cache knows what to do with this cache extension, false otherwise.

    Returns true if the cache knows what to do with this cache extension, false otherwise.

    Definition Classes
    AhcHttpCacheCacheDefaultsCache
  42. def isCacheableMethod(requestMethod: String): Boolean

    Permalink

    Defines cacheable methods.

    Defines cacheable methods.

    Definition Classes
    CacheDefaultsCache
  43. def isDefaultCacheable(statusCode: Int): Boolean

    Permalink

    Returns true if the response code is cacheable by default.

    Returns true if the response code is cacheable by default.

    Definition Classes
    CacheDefaultsCache
  44. def isError(response: CacheableResponse): Boolean

    Permalink
  45. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  46. def isNonErrorResponse(response: CacheableResponse): Boolean

    Permalink
    Attributes
    protected
  47. def isNotModified(response: CacheableResponse): Boolean

    Permalink
  48. def isShared: Boolean

    Permalink

    Cache is not shared.

    Cache is not shared.

    Definition Classes
    AhcHttpCacheCache
  49. def isUncachedResponse(any: Any): Boolean

    Permalink

  50. def isUnderstoodStatusCode(statusCode: Int): Boolean

    Permalink

    Cache understands the response status code behavior for caching purposes.

    Cache understands the response status code behavior for caching purposes.

    Definition Classes
    CacheDefaultsCache
  51. def isUnsafeMethod(request: Request): Boolean

    Permalink
  52. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  53. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  54. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  55. def put(key: EffectiveURIKey, entry: ResponseEntry): Future[Unit]

    Permalink
  56. def remove(key: EffectiveURIKey): Future[Unit]

    Permalink
  57. def replaceHeaders(response: CacheableResponse)(block: (HttpHeaders) ⇒ HttpHeaders): CacheableResponse

    Permalink
  58. def selectionAction(request: Request, entries: Seq[ResponseEntry]): ResponseSelectionAction

    Permalink
  59. def serveAction(request: Request, entry: ResponseEntry, currentAge: Seconds): ResponseServeAction

    Permalink
  60. def stripHeaders(request: Request, httpResponse: CacheableResponse): CacheableResponse

    Permalink

    Strips headers using a strip headers cache-control calculator.

    Strips headers using a strip headers cache-control calculator.

    Attributes
    protected
  61. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  62. def toString(): String

    Permalink
    Definition Classes
    AhcHttpCache → AnyRef → Any
  63. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Debug

Inherited from AhcUtilities

Inherited from CacheDefaults

Inherited from Cache

Inherited from AnyRef

Inherited from Any

Ungrouped