Welcome! Log In Create A New Profile


fastcgi_cache and Wordpress-mu

Posted by salvator 
fastcgi_cache and Wordpress-mu
July 07, 2009 05:18AM
Hello. I have an WP-mu installation as php-fastcgi and nginx as web server.
Here is the cache-related config:

http {
fastcgi_cache_path /usr/cache/nginx levels=1:2 keys_zone=php:10m;
server {
# ....
location ~ .php$ {
fastcgi_cache php;
fastcgi_cache_key $host$request_uri;
fastcgi_cache_min_uses 1;
is that something wrong there? nginx creates an empty dirs in cache folders, but no files does. Help me, please.

I'm using nginx-0.7.61 on FreeBSD 7.2-STABLE
Re: fastcgi_cache and Wordpress-mu
July 07, 2009 02:32PM
Do you have a fastcgi_pass statement in that block?

If you are going to do this you should include some cookie checking conditionals so that users aren't able to see the admin's version of the pages. You might be better off with the WordPress super cache plugin.

Jim Ohlstein
Re: fastcgi_cache and Wordpress-mu
July 07, 2009 02:42PM
[b]Jim[/b], there is fastcgi_pass section in [u]location ~ \.php[/u] area. I'm looking for nginx caching solution, WP Super cache is the last variant - if nginx wouldn't work.

Is fastcgi_cache read Cache-control headers?
Re: fastcgi_cache and Wordpress-mu
July 07, 2009 02:55PM
I understand that. It's part of the fastcgi module. I believe that you need to have the cache statements in the same block as the fastcgi_pass (I could be wrong, I set this up a little while ago but Igor helped me with the configuration). It's why I asked. Feel free to not take my advice.

Here's a working configuration where I have a 6-8GB cache of image files:

location ~ (png|gif|jpg|jpeg)$ {
fastcgi_pass unix:/tmp/my.sock;
fastcgi_cache one;
fastcgi_cache_key unix:/tmp/my.sock.1$request_uri;
fastcgi_ignore_headers Cache-Control Expires;
fastcgi_cache_valid 200 302 1d;
fastcgi_cache_valid 301 7d;
fastcgi_cache_valid any 5m;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_NAME myscript;
fastcgi_buffers 64 8k;


Jim Ohlstein
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 273
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