Skip to content

Instantly share code, notes, and snippets.

@guiltry
Last active April 12, 2016 11:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guiltry/c727a6531dafcc61fdfe52f0a7cf0380 to your computer and use it in GitHub Desktop.
Save guiltry/c727a6531dafcc61fdfe52f0a7cf0380 to your computer and use it in GitHub Desktop.
....
def cache_control do
control = logged_in? ? 'private' : 'public'
response.headers['Cache-Control'] = "#{control}, max-age=0, must-revalidate"
end
...
...
if (beresp.http.Cache-Control ~ "public") {
unset beresp.http.Set-Cookie;
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment