Skip to content

Instantly share code, notes, and snippets.

@lynt-smitka
Last active October 8, 2015 06:20
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 lynt-smitka/9bd00edc170f4ff7fe33 to your computer and use it in GitHub Desktop.
Save lynt-smitka/9bd00edc170f4ff7fe33 to your computer and use it in GitHub Desktop.
Nástin možnosti řešení výjimek pro Nginx microcache
set $no_cache "";
if ($request_method !~ ^(GET|HEAD)$) {
set $no_cache "1";
}
if ($http_cookie ~* "nocache") {
set $no_cache "1";
}
fastcgi_cache microcache;
fastcgi_cache_key $request_method|$host|$request_uri;
fastcgi_cache_valid 404 15s;
fastcgi_cache_valid any 2m;
fastcgi_no_cache $no_cache;
fastcgi_cache_bypass $no_cache;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment