Welcome! Log In Create A New Profile

Advanced

Re: fastcgi caching

Maxim Dounin
February 23, 2014 09:08AM
Hello!

On Fri, Feb 21, 2014 at 12:00:47PM -0800, Grant wrote:

> I'm using the following config to cache only /piwik/piwik.php:
>
> fastcgi_cache_path /var/cache/php-fpm levels=1:2 keys_zone=piwik:10m;
>
> fastcgi_cache_key "$scheme$request_method$host$request_uri";
>
> location /piwik/piwik.php {
> fastcgi_cache piwik;
> add_header X-Cache $upstream_cache_status;
> fastcgi_pass unix:/run/php-fpm.socket;
> include fastcgi.conf;
> }
>
> I'm getting "X-Cache: HIT". I tried to set up a minimal config, but
> am I missing anything essential? Is setting up a manual purge
> required or will this manage itself?

Unless explicitly told to do otherwise, nginx will cache responses
based on validity specified using Expires and/or Cache-Control
headers. That is, if your backend uses headers correctly, no
futher action required.

--
Maxim Dounin
http://nginx.org/

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

fastcgi caching

Grant February 21, 2014 03:02PM

Re: fastcgi caching

Maxim Dounin February 23, 2014 09:08AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 90
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready