Packages

c

play.api.libs.ws.ahc.cache

AhcHttpCache

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.

Linear Supertypes
Debug, AhcUtilities, CacheDefaults, org.playframework.cachecontrol.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. Protected

Instance Constructors

  1. new AhcHttpCache(underlying: Cache, heuristicsEnabled: Boolean = false)(implicit executionContext: ExecutionContext)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addDisconnectHeader(response: CacheableResponse): CacheableResponse
  5. def addRevalidationFailed(response: CacheableResponse): CacheableResponse
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def cacheResponse(request: Request, response: CacheableResponse): Unit

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

  8. def cachingAction(request: Request, response: CacheableResponse): ResponseCachingAction
  9. def calculateCurrentAge(request: CacheRequest, response: StoredResponse, requestTime: ZonedDateTime, responseTime: ZonedDateTime): Seconds

    Calculates the current age of the stored response.

    Calculates the current age of the stored response.

    Attributes
    protected
  10. def calculateCurrentAge(request: Request, entry: ResponseEntry, requestTime: ZonedDateTime): Seconds

    Calculates the current age of the stored response.

  11. def calculateFreshnessFromHeuristic(request: CacheRequest, response: CacheResponse): Option[Seconds]
    Definition Classes
    AhcHttpCache → Cache
  12. def calculateFreshnessLifetime(request: Request, entry: ResponseEntry): Seconds

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

    Calculates the secondary keys of the request.

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

    Calculates the time to live.

    Calculates the time to live. Currently hardcoded to 24 hours.

    Attributes
    protected
  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  16. def close(): Unit
  17. def containsMatchingHeaders(presentedHeaders: Map[HeaderName, Seq[String]], nominatedHeaders: Map[HeaderName, Seq[String]]): Boolean
    Definition Classes
    CacheDefaults → Cache
  18. def debug(bodyPart: HttpResponseBodyPart): String
    Definition Classes
    Debug
  19. def debug[T](ctx: FilterContext[T]): String
    Definition Classes
    Debug
  20. def debug[T](handler: AsyncHandler[T]): String
    Definition Classes
    Debug
  21. def debug(bodyParts: List[HttpResponseBodyPart]): String
    Definition Classes
    Debug
  22. def debug(responseHeaders: HttpHeaders): String
    Definition Classes
    Debug
  23. def debug(responseStatus: HttpResponseStatus): String
    Definition Classes
    Debug
  24. def debug(response: Response): String
    Definition Classes
    Debug
  25. def debug(request: Request): String
    Definition Classes
    Debug
  26. def debug(cfg: AsyncHttpClientConfig): String
    Definition Classes
    Debug
  27. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  29. implicit val executionContext: ExecutionContext
  30. def freshenResponse(newHeaders: HttpHeaders, response: CacheableResponse): CacheableResponse

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

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

  33. def generateOriginResponse(request: Request, status: Int, responseHeaders: HttpHeaders): OriginResponse
    Attributes
    protected
  34. def generateStoredResponse(response: CacheableResponse, requestMethod: String, nominatedHeaders: Map[HeaderName, Seq[String]]): StoredResponse
    Attributes
    protected
  35. def get(key: EffectiveURIKey): Future[Option[ResponseEntry]]
  36. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  37. def getURI(response: CacheableResponse, headerName: String): Option[URI]

    Gets the effective URI of the response.

    Gets the effective URI of the response.

    Attributes
    protected
  38. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  39. def headersToMap(headers: HttpHeaders): TreeMap[String, Seq[String]]
    Definition Classes
    AhcUtilities
  40. def invalidateIfUnsafe(request: Request, response: CacheableResponse): Unit

    Invalidates the effective request URI if the method is unsafe.

  41. def invalidateKey(key: EffectiveURIKey): Unit

    Invalidates the key.

  42. def isCacheableExtension(extension: CacheDirectiveExtension): Boolean
    Definition Classes
    AhcHttpCache → CacheDefaults → Cache
  43. def isCacheableMethod(requestMethod: String): Boolean
    Definition Classes
    CacheDefaults → Cache
  44. def isDefaultCacheable(statusCode: Int): Boolean
    Definition Classes
    CacheDefaults → Cache
  45. def isError(response: CacheableResponse): Boolean
  46. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  47. def isNonErrorResponse(response: CacheableResponse): Boolean
    Attributes
    protected
  48. def isNotModified(response: CacheableResponse): Boolean
  49. def isShared: Boolean

    Cache is not shared.

    Cache is not shared.

    Definition Classes
    AhcHttpCache → Cache
  50. def isUncachedResponse(any: Any): Boolean

  51. def isUnderstoodStatusCode(statusCode: Int): Boolean
    Definition Classes
    CacheDefaults → Cache
  52. def isUnsafeMethod(request: Request): Boolean
  53. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  54. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  55. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  56. def put(key: EffectiveURIKey, entry: ResponseEntry): Future[Unit]
  57. def remove(key: EffectiveURIKey): Future[Unit]
  58. def replaceHeaders(response: CacheableResponse)(block: (HttpHeaders) => HttpHeaders): CacheableResponse
  59. def selectionAction(request: Request, entries: Seq[ResponseEntry]): ResponseSelectionAction
  60. def serveAction(request: Request, entry: ResponseEntry, currentAge: Seconds): ResponseServeAction
  61. def stripHeaders(request: Request, httpResponse: CacheableResponse): CacheableResponse

    Strips headers using a strip headers cache-control calculator.

    Strips headers using a strip headers cache-control calculator.

    Attributes
    protected
  62. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  63. def toString(): String
    Definition Classes
    AhcHttpCache → AnyRef → Any
  64. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  65. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  66. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Debug

Inherited from AhcUtilities

Inherited from CacheDefaults

Inherited from org.playframework.cachecontrol.Cache

Inherited from AnyRef

Inherited from Any

Ungrouped