Welcome! Log In Create A New Profile

Advanced

Allow reverse proxy cache to store private response?

Posted by silentmiles 
Allow reverse proxy cache to store private response?
May 14, 2015 11:43PM
Hi All,

Has there been any consideration of providing a configuration directive with the same effect as Apache's CacheStorePrivate directive for reverse proxy caching, such as fastcgi_cache?

http://httpd.apache.org/docs/2.4/mod/mod_cache.html#cachestoreprivate

"Ordinarily, responses with Cache-Control: private header values will not be stored in the cache. The CacheStorePrivate directive allows this behavior to be overridden. CacheStorePrivate On tells the server to attempt to cache the resource even if it contains private header values. Resources requiring authorization will never be cached."

My use case: I have an API which always returns "Cache-Control: private" because the responses contain user data. But, this reverse proxy cache is sitting on my own network, so I consider it to be private. I just don't want any interim caches between my infrastructure and the user's browser to cache the results.

Thoughts? Or anyone have any work-around recommendations?
Re: Allow reverse proxy cache to store private response?
May 15, 2015 02:45AM
Maybe use 'map' to determine which responses to cache and which not?

---
nginx for Windows http://nginx-win.ecsds.eu/
Re: Allow reverse proxy cache to store private response?
May 17, 2015 10:14PM
I don't understand your suggestion. How would map allow me to override Nginx regarding private responses? AFAIK, Nginx will not store any content that has a "Cache-Control: private" header in the response, and there's no way to tell it to do so.
Re: Allow reverse proxy cache to store private response?
May 18, 2015 02:53AM
Then maybe with Lua you could capture the response and change it accordingly.

---
nginx for Windows http://nginx-win.ecsds.eu/
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 111
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready