atom feed15 messages in ru.sysoev.nginxRe: Fastcgi cache
FromSent OnAttachments
Jim OhlsteinMay 9, 2009 12:02 pm 
"坏人"May 11, 2009 9:01 pm 
Igor SysoevMay 11, 2009 11:33 pm 
Delta YehMay 12, 2009 3:09 am 
Jim OhlsteinMay 12, 2009 9:06 pm 
Igor SysoevMay 12, 2009 9:25 pm 
Jim OhlsteinMay 13, 2009 7:58 am 
Igor SysoevMay 13, 2009 8:03 am 
Jim OhlsteinMay 13, 2009 8:42 am 
Igor SysoevMay 13, 2009 8:52 am 
Jim OhlsteinMay 13, 2009 10:35 am 
Jim OhlsteinMay 19, 2009 2:09 pm 
Maxim DouninMay 19, 2009 2:32 pm 
Jim OhlsteinMay 19, 2009 2:48 pm 
Payam ChychiMay 19, 2009 10:30 pm 
Subject:Re: Fastcgi cache
From:Jim Ohlstein (ngin@nginx.us)
Date:May 13, 2009 7:58:50 am
List:ru.sysoev.nginx

Igor Sysoev Wrote:

-------------------------------------------------------

On Wed, May 13, 2009 at 12:06:33AM -0400, Jim Ohlstein wrote:

Igor Sysoev Wrote:

--------------------------------------------------

-----

On Sat, May 09, 2009 at 03:02:53PM -0400, Jim Ohlstein wrote:

Is there any way to set the it just to

cache

image and other media files, but not text/html? I only see based on response in the Russian docs (best as I can understand). Is that something that can be added or is planned?

No, currently nginx can not cache using content-type, but it can be easy added. Also you may use location to separate responses.

Can you give a sample configuration of how that would work.

I have tried putting location blocks in and out

of the main fastcgi_pass block without any success.

location ~ \.php$ { fastcgi_pass ... }

location ~ \.(jpg|gif|png)$ { fastcgi_pass ... fastcgi_cache ... }

That's what I tried first: It's a Perl script and I am using fcgiwrap.

location ~ myscript { fastcgi_pass unix:/tmp/cgi.sock; include /usr/local/nginx/conf/fastcgi_params; fastcgi_buffers 64 8k; }

location ~ \.(jpg|gif|png)$ { fastcgi_pass unix:/tmp/cgi.sock; fastcgi_cache one; fastcgi_cache_key unix:/tmp/cgi.sock.1$request_uri; fastcgi_cache_valid 200 302 5m; fastcgi_cache_valid 301 1d; fastcgi_cache_valid any 5m; include /usr/local/nginx/conf/fastcgi_params; fastcgi_buffers 64 8k; }

The only thing that winds up in the cache is when there is a 403.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,1890,2000#msg-2000