Browser Cache policy

Strong cache

Http1.0

  • Pragma

    • Pragma: no-cache is used

      Pragma has only one value: no-cache, which indicates that caching is disabled, to enable caching. We need to remove the Pragma header field

  • Expries

    • Set a GMT time to define the cache expiration time

Http1.1

  • Cache-Control

    • Enable caching and define cache expiration times

Negotiate the cache

Http1.0

  • There is no

Http1.1

  • Last-Modified

    • If-Modified-Since

      • If the modified time matches, 304 is returned. Otherwise, the server resends resources
    • If-Unmodified-Since

      • If the modified time matches, 304 is returned, otherwise 412 is returned (not recommended, 4XX error is returned).
  • ETag

    • If-None-Match

      • If the eTAG indicates a match, 304 is returned; otherwise, the server resends the resource
    • If-Match

      • 304 is returned if the eTAG match is successful, otherwise 412 is returned (not recommended, 4XX error is returned).

priority

Strong cache > Negotiated cache

Pragma > Cache-Control > Expires

ETag/If-None-Match > Last-Modified/If-Modified-Since

XMind – Trial Version