Welcome! Log In Create A New Profile

Advanced

Re: fastcgi_cache_path empty

Lorenzo Raffio
January 16, 2014 07:16PM
Thanks Steve for the reply!!

Ok, so tell me if I understood correcty. You just have in your "vhost"
server block this:
fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=microcache:10m
max_size=1000m inactive=60m;

and then you have a file /etc/nginx/microcache with

# Setup var defaults
set $no_cache "";
# If non GET/HEAD, don't cache & mark user as uncacheable for 1 second
via cookie
if ($request_method !~ ^(GET|HEAD)$) {
set $no_cache "1";
}
# Drop no cache cookie if need be
# (for some reason, add_header fails if included in prior if-block)
if ($no_cache = "1") {
add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
add_header X-Microcachable "0";
}
# Bypass cache if no-cache cookie is set
if ($http_cookie ~* "_mcnc") {
set $no_cache "1";
}

# Bypass cache if flag is set
fastcgi_no_cache $no_cache;
fastcgi_cache_bypass $no_cache;
fastcgi_cache microcache;
fastcgi_cache_key "$scheme$request_method$host$request_uri
$http_if_modified_since$http_if_none_match";
fastcgi_cache_valid 404 30m;
fastcgi_cache_valid 200 10s;
fastcgi_max_temp_file_size 1M;
fastcgi_cache_use_stale updating;
fastcgi_pass_header Set-Cookie;
fastcgi_pass_header Cookie;
fastcgi_ignore_headers Cache-Control Expires Set-Cookie;

... correct?
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

fastcgi_cache_path empty

Lorenzo Raffio January 13, 2014 05:14PM

Re: fastcgi_cache_path empty

Lorenzo Raffio January 16, 2014 02:22PM

Re: fastcgi_cache_path empty

GreenGecko January 16, 2014 03:08PM

Re: fastcgi_cache_path empty

Lorenzo Raffio January 16, 2014 07:16PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 279
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready