proxy_cache not writing to proxy_cache_path

Maxim Dounin mdounin at mdounin.ru
Fri Nov 12 02:05:10 MSK 2010


Hello!

On Thu, Nov 11, 2010 at 04:49:52PM -0500, gms8994 wrote:

> I've got a config file like:
> 
> http {
>    proxy_cache_path /var/www/nginx/cache levels=1:2
> keys_zone=tmpcache:100m;
> 
>    server {
>       location ~ \.js$  {
>          proxy_cache        tmpcache;
>          proxy_cache_key    $uri$is_args$args;
>          proxy_pass http://global;
>       }
>    }
> }
> 
> However, I'm not seeing any data stored in the tmpcache. No folders
> created, no files. What am I missing?

Without proxy_cache_valid nginx will only cache responses which 
explicitly indicate they may be cached (either with Expires header 
in future or with Cache-Control: max-age=).

See here:

http://wiki.nginx.org/HttpProxyModule#proxy_cache_valid

Maxim Dounin



More information about the nginx mailing list