# Proxy\_cache not writing to proxy\_cache\_path

**URL:** <https://www.ruby-forum.com/t/proxy-cache-not-writing-to-proxy-cache-path/198984>\
**Category:** NGINX\
**Created:** [November 11, 2010, 10:51pm UTC](https://www.ruby-forum.com/t/proxy-cache-not-writing-to-proxy-cache-path/198984 "2010-11-11T22:51:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [November 11, 2010, 10:51pm UTC](https://www.ruby-forum.com/t/proxy-cache-not-writing-to-proxy-cache-path/198984/1 "2010-11-11T22:51:19Z")

</div>

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](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:

> **[proxy\_cache not writing to proxy\_cache\_path](https://forum.nginx.org/read.php?2,149945,149945#msg-149945)**
>
> 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;

---

<div class="post-metadata">

**Author:** ![gms8994](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gms8994](https://www.ruby-forum.com/u/gms8994)\
**Post date:** [November 12, 2010, 3:55pm UTC](https://www.ruby-forum.com/t/proxy-cache-not-writing-to-proxy-cache-path/198984/2 "2010-11-12T15:55:39Z")

</div>

Thanks for the help Maxim! That did it!

Posted at Nginx Forum:

> **[Re: proxy\_cache not writing to proxy\_cache\_path](https://forum.nginx.org/read.php?2,149945,150143#msg-150143)**
>
> 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;

---

<div class="post-metadata">

**Author:** ![gms8994](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e9bcb4/32.png) [@gms8994](https://www.ruby-forum.com/u/gms8994)\
**Post date:** [November 12, 2010, 12:06am UTC](https://www.ruby-forum.com/t/proxy-cache-not-writing-to-proxy-cache-path/198984/3 "2010-11-12T00:06:06Z")

</div>

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:

> **[GitHub - nginxinc/nginx-wiki: ARCHIVED -- Source for the now archived NGINX Wiki...](https://github.com/nginxinc/nginx-wiki)**
>
> ARCHIVED -- Source for the now archived NGINX Wiki section of https://www.nginx.com

Maxim D.
