nginx-0.7.44
Igor Sysoev
is at rambler-co.ru
Mon Mar 23 19:52:52 MSK 2009
On Mon, Mar 23, 2009 at 05:57:27PM +0300, Igor Sysoev wrote:
> On Mon, Mar 23, 2009 at 10:42:45PM +0800, Delta Yeh wrote:
>
> > How to use the cache feature?
> > What kind of cache does it support?
>
> Here is configuraiton example:
>
> http {
> proxy_cache_path /path/to/cache levels=1:2
> keys_zone=NAME:10m
> inactive=5m clean_time=2h00m;
>
> server {
> location / {
> proxy_pass http://127.0.0.1;
>
> proxy_cache NAME;
>
> proxy_cache_valid 200 302 1h;
> proxy_cache_valid 301 1d;
> proxy_cache_valid any 1m;
>
> proxy_cache_min_uses 1;
>
> proxy_cache_use_stale error timeout invalid_header http_500;
> }
> }
>
> The cache currently ignores backend's Cache-Control, Expires, etc.
The attached patch enables caching for FastCGI. The directives are the same
as in proxy cache, just change proxy_ prefix to fastcgi_ one. Plus
fastcgi_cache_key 127.0.0.1:9000$request_uri;
to evaluate unique key in cache. In proxy the key is evalueyed intrnally
is something like
$schema$proxy_host:$proxy_port$uri$is_args$args
--
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.fastcgi.cache
Type: chemical/x-cache
Size: 8902 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx/attachments/20090323/ac41eb1c/attachment.cache>
More information about the nginx
mailing list