<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">No one? :)<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014/1/13 Lorenzo Raffio <span dir="ltr"><<a href="mailto:multiformeingegno@gmail.com" target="_blank">multiformeingegno@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">I wanted to try fastcgi_cache on my nginx 1.5.8 as shown here <a href="http://seravo.fi/2013/optimizing-web-server-performance-with-nginx-and-php" target="_blank">http://seravo.fi/2013/optimizing-web-server-performance-with-nginx-and-php</a><br>
</div><div class="gmail_default" style="font-family:georgia,serif"><br>In nginx conf, http section, I added:<br><br>fastcgi_cache_path /var/cache/nginx levels=1:2 keys_zone=microcache:10m max_size=1000m inactive=60m;<br>
<br>
</div><div class="gmail_default" style="font-family:georgia,serif">In server section:<br> set $cache_uri $request_uri;<br><br> # POST requests and urls with a query string should always go to PHP<br> if ($request_method = POST) {<br>
set $cache_uri 'null cache';<br> }<br> if ($query_string != "") {<br> set $cache_uri 'null cache';<br> }<br><br> # Don't cache uris containing the following segments<br>
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {<br>
set $cache_uri 'null cache';<br> }<br><br> # Don't use the cache for logged in users or recent commenters<br> if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") {<br>
set $cache_uri 'null cache';<br> }<br><br> location ~ \.php$ {<br> try_files $uri =404;<br> fastcgi_split_path_info ^(.+\.php)(/.+)$; <br> include fastcgi.conf;<br> fastcgi_pass unix:/var/run/php5-fpm.sock;<br>
<br><br> ##<br> # Fastcgi cache<br> ##<br> set $skip_cache 1;<br> if ($cache_uri != "null cache") {<br> add_header X-Cache-Debug "$cache_uri $cookie_nocache $arg_nocache$arg_comment $http_pragma $http_authorization";<br>
set $skip_cache 0;<br> }<br> fastcgi_cache_bypass $skip_cache;<br> fastcgi_cache_key $scheme$host$request_uri$request_method;<br> fastcgi_cache_valid any 8m;<br> fastcgi_cache_bypass $http_pragma;<br>
fastcgi_cache_use_stale updating error timeout invalid_header http_500;<br><br> }<br><br>I chowned /var/cache/nginx to www-data user (and group) and chmodded it to 775.<br></div><div class="gmail_default" style="font-family:georgia,serif">
I restarted nginx but the folder is always empty. Is it normal? How can I test if fastcgi_cache is working?<br><br>Thanks in advance<br></div></div>
</blockquote></div><br></div>