Skip to content

Instantly share code, notes, and snippets.

@lawloretienne
Last active November 3, 2017 14:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lawloretienne/aaca8e3d3e141c8754876b56561a9c87 to your computer and use it in GitHub Desktop.
Save lawloretienne/aaca8e3d3e141c8754876b56561a9c87 to your computer and use it in GitHub Desktop.
  • CacheControl.FORCE_CACHE adds an only-if-cache flag and also sets the max-stale to a very high value which overrides the max-stale value.
  • The max-age request directive indicates that the client is unwilling to accept a response whose age is greater than the specified number of seconds. Unless the max-stale request directive is also present, the client is not willing to accept a stale response.
  • The max-stale request directive indicates that the client is willing to accept a response that has exceeded its freshness lifetime. If max-stale is assigned a value, then the client is willing to accept a response that has exceeded its freshness lifetime by no more than the specified number of seconds.
  • The max-age request directive is the oldest that a response can be, as long as the Cache-Control from the origin server indicates that it is still fresh. The max-stale request directive indicates that, even if the response is known to be stale, you will also accept it as long as it's only stale by that number of seconds.
  • A cache should generate a Warning header field with the 110 warn-code in stale responses. If you specified max-stale and received a no-longer-fresh response, the Warning header would let you know.

####Resources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment