c

org.playframework.cachecontrol

FreshnessCalculator

class FreshnessCalculator extends AnyRef

Calculates freshness lifetime for a request.

Source
FreshnessCalculator.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. FreshnessCalculator
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new FreshnessCalculator(cache: Cache)

Value Members

  1. def calculateFreshnessFromExpires(request: CacheRequest, response: CacheResponse): Option[Seconds]

    Returns the freshness duration as calculated from the Expires header.

    Returns the freshness duration as calculated from the Expires header.

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

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

    Returns the freshness lifetime from heuristics, or None if the response is stale.

    Returns the freshness lifetime from heuristics, or None if the response is stale.

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

  3. def calculateFreshnessFromMaxAge(request: CacheRequest, response: CacheResponse): Option[Seconds]

    Returns the freshness duration as calculated from the Max-Age cache directive.

    Returns the freshness duration as calculated from the Max-Age cache directive.

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

  4. def calculateFreshnessFromSMaxAge(request: CacheRequest, response: CacheResponse): Option[Seconds]

    Calculates the freshness lifetime from the s-maxage cache directive, if the cache is shared.

  5. def calculateFreshnessLifetime(request: CacheRequest, response: CacheResponse): Seconds

    Returns the freshness lifetime in seconds.

    Returns the freshness lifetime in seconds.

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

  6. def isFreshnessInformationInvalid(request: CacheRequest, response: CacheResponse): Boolean

    Returns true if the freshness information is invalid, false otherwise.

  7. def unapplySeq(directives: Seq[CacheDirective]): Option[Seconds]