Proxy_cache not writing to proxy_cache_path

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?

Posted at Nginx Forum:

Thanks for the help Maxim! That did it!

Posted at Nginx Forum:

Hello!

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

     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 D.