1. 4
  1.  

  2. 3

    Geeze. No wonder cache directives aren’t used more. I still don’t understand exactly what the example does. It caches on the proxy, but not the client, but also tells the proxy to revalidate every request? So when is it caching?

    1. 2

      The rfc is a bit more clear.

      I think the proxy will only do a conditional get (‘if-modified-since’ or ‘if-none-match’) request to check validity (proxy-revalidate) for up to 7200 seconds (s-maxage), assuming it gets ‘not modified’ responses in the interim. After 7200 seconds I think the proxy will fetch the upstream version regardless (get no longer conditional). This would at least save transferring the entire content – of course assume the actual content it is larger than all the extra headers being sent!

      The client, I believe, would consider the local cache always stale (max-age=0), so I think it will cache locally, but will do a conditional get every time.

      I think the presented config attempts to only save transmitting the actual body unless something changes, but always checking every point along the way with conditional gets to ensure that the current version is the latest.

      No joke about being damned confusing. I probably got something wrong.