Package

com.typesafe.play

cachecontrol

Permalink

package cachecontrol

Visibility
  1. Public
  2. All

Type Members

  1. trait Cache extends AnyRef

    Permalink

    This trait defines methods that are used through the library where core business logic belongs to the cache that is not in scope for RFC 7234 and cannot be predefined.

  2. class CacheControlException extends RuntimeException

    Permalink
  3. trait CacheDefaults extends Cache

    Permalink
  4. sealed trait CacheDirective extends AnyRef

    Permalink

    A trait that marks the cache directives generated from parsing a cache-control header.

  5. case class CacheRequest(uri: URI, method: String, headers: Map[HeaderName, Seq[String]]) extends Product with Serializable

    Permalink

    An incoming request which may be served from cache.

  6. trait CacheResponse extends AnyRef

    Permalink
  7. class CurrentAgeCalculator extends AnyRef

    Permalink

    Calculates the current age of a response.

    Calculates the current age of a response.

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

  8. class FreshnessCalculator extends AnyRef

    Permalink

    Calculates freshness lifetime for a request.

  9. case class HeaderName(raw: String) extends Ordered[HeaderName] with Product with Serializable

    Permalink
  10. case class OriginResponse(uri: URI, status: Int, headers: Map[HeaderName, Seq[String]]) extends CacheResponse with Product with Serializable

    Permalink

    A response from an origin server.

  11. sealed trait ResponseCachingAction extends AnyRef

    Permalink
  12. class ResponseCachingCalculator extends AnyRef

    Permalink

    Decides whether this response from an origin server should be stored in cached or not.

    Decides whether this response from an origin server should be stored in cached or not.

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

  13. sealed trait ResponseSelectionAction extends AnyRef

    Permalink
  14. class ResponseSelectionCalculator extends AnyRef

    Permalink

    This class looks through the available responses, and provides an action -- either selecting a response, or rejecting with either a timeout or forward to origin.

    This class looks through the available responses, and provides an action -- either selecting a response, or rejecting with either a timeout or forward to origin. The cache's containsMatchingHeaders method is called in the case where the response has secondary keys (defined with Vary) that must be matched.

  15. sealed trait ResponseServeAction extends AnyRef

    Permalink
  16. class ResponseServingCalculator extends AnyRef

    Permalink

    This class determines whether a cache can serve a stored response from request.

    This class determines whether a cache can serve a stored response from request. It is "Constructing Responses from Caches" section in RFC 7234.

    If there are multiple matches, the most recent response must be sent for evaluation, as determined by the Date header field.

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

  17. class SecondaryKeyCalculator extends AnyRef

    Permalink

    This class produces secondary keys for a response from an origin server that contains a Vary header.

    This class produces secondary keys for a response from an origin server that contains a Vary header.

    The cache must store the response with the requested header from the original request, so that subsequent requests match. This is a little confusing, so an example follows:

    A request comes in with:

    GET /some/path HTTP/1.1
    Host: example.com
    Accept-Encoding: gzip
    

    The response comes back with a Vary header on the Accept-Encoding:

    HTTP/1.1 200 OK
    Vary: Accept-Encoding
    Content-Encoding: gzip
    Content-Type: application/json
    Content-Length: 230
    Cache-Control: max-age=10000000
    

    The cache has to look at the Vary header, see that "Accept-Encoding" is a header on the request, and then store "Accept-Encoding: gzip" as a secondary key on the cache entry.

    The implication is that the primary key entry of "GET http://example.com/some/path" is insufficient, and in order to get that specific response from cache, any subsequent requests should have a "Accept-Encoding: gzip" header in the same way.

    See also

    https://tools.ietf.org/html/rfc7231#section-7.1.4

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

  18. case class StoredResponse(uri: URI, status: Int, headers: Map[HeaderName, Seq[String]], requestMethod: String, nominatedHeaders: Map[HeaderName, Seq[String]]) extends CacheResponse with Product with Serializable

    Permalink

    A response that comes from cache.

    A response that comes from cache.

    uri

    the effective request URI. This is part of the primary cache lookup key.

    status

    the numeric cached response status code.

    headers

    the headers on the stored response.

    requestMethod

    the original request method that was used to generate the stored response.

    nominatedHeaders

    the request headers that were nominated by the response's Vary header.

  19. class StripHeaderCalculator extends AnyRef

    Permalink

    Tells the cache what headers should be stripped before they are cached.

  20. case class Warning(code: Int, agent: String, text: String, date: Option[DateTime] = None) extends Product with Serializable

    Permalink

    A parsed warning.

Value Members

  1. object CacheDirectiveParser

    Permalink

    The parser for cache directives specified in the "Cache-Control" HTTP header.

    The parser for cache directives specified in the "Cache-Control" HTTP header.

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

  2. object CacheDirectives

    Permalink
  3. object CurrentAgeCalculator

    Permalink
  4. object HeaderNames

    Permalink
  5. object HttpDate

    Permalink

    Defines methods for parsing and formatting HTTP dates.

  6. object ResponseCachingActions

    Permalink

    Case classes used by ResponseCachingPolicy.

  7. object ResponseCachingCalculator

    Permalink
  8. object ResponseSelectionActions

    Permalink

    Predefined actions to take for a selected response.

  9. object ResponseSelectionCalculator

    Permalink
  10. object ResponseServeActions

    Permalink

    The possible actions a client can execute when determining to serve a stored response.

  11. object ResponseServingCalculator

    Permalink
  12. object SecondaryKeyCalculator

    Permalink
  13. object VaryParser

    Permalink

    Parses the Vary header in to a list of field names.

  14. object WarningParser

    Permalink

Ungrouped