# Proxy\_no\_cache issue

**URL:** <https://www.ruby-forum.com/t/proxy-no-cache-issue/190922>\
**Category:** NGINX\
**Created:** [June 30, 2010, 9:53pm UTC](https://www.ruby-forum.com/t/proxy-no-cache-issue/190922 "2010-06-30T21:53:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@msony](https://www.ruby-forum.com/u/msony)\
**Post date:** [June 30, 2010, 9:53pm UTC](https://www.ruby-forum.com/t/proxy-no-cache-issue/190922/1 "2010-06-30T21:53:42Z")

</div>

I understand you can use proxy\_no\_cache to update the cache, my setup is  
like this:  
proxy\_cache\_valid 200 302 20m;  
proxy\_cache\_valid 404 1m;  
proxy\_no\_cache $http\_my\_secret\_header;

And I send the header like this : curl -H “My-Secret-Header: 1”  
“[www.example.com](http://www.example.com)”

Which seems to pull the updated information, however if I understand it  
properly it should update the cache with latest response. But it’s not  
doing that, all the new hits are pulling information from cache till  
actually cache expires. Any idea on how to do this properly ?

Posted at Nginx Forum:

> **[proxy\_no\_cache issue](https://forum.nginx.org/read.php?2,104020,104020#msg-104020)**
>
> I understand you can use proxy\_no\_cache to update the cache, my setup is like this: proxy\_cache\_valid 200 302 20m; proxy\_cache\_valid 404 1m; proxy\_no\_cache $http\_my\_secret\_header; And I send the header like this : curl -H

---

<div class="post-metadata">

**Author:** ![msony](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ed655f/32.png) [@msony](https://www.ruby-forum.com/u/msony)\
**Post date:** [June 30, 2010, 10:15pm UTC](https://www.ruby-forum.com/t/proxy-no-cache-issue/190922/2 "2010-06-30T22:15:21Z")

</div>

Hi,

> Any idea on how to do this properly ?

AFAIK your backend must set “X-Accel-Expires” header with value \> 0 to  
force  
cache update in “\_no\_cache” scenario.

Best regards,  
Piotr S. \< [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) \>
