Hi Peter, When we used this: proxy_set_header If-Modified-Since $http_if_modified_since ....Nginx was caching 304 responses from the upstream when the client requested If-Modified-Since (if it was the first request for that object). Future requests by clients that didn't set the If-Modified-Since header were also being served the 304 (with no body) as that was what was in the cache. I hopby ryanrbftp - Nginx Mailing List - English
So this config seems to work: proxy_cache_valid 200 3M; proxy_cache_valid 304 0; proxy_cache_valid 404 0; proxy_cache_revalidate on; proxy_ignore_headers Cache-Control Expires; There is no need for: proxy_set_header If-Modified-Since $http_if_modified_since; On 26/07/2017 09:57, Ryan Barclay wrote: > > Thanks for the reply Peter. > > I've noticed something interesting and wonderby ryanrbftp - Nginx Mailing List - English
Thanks for the reply Peter. I've noticed something interesting and wondered if you could shed some light on it. Simply adding: proxy_ignore_headers Cache-Control Expires; Enables 304 responses from the origin server without setting: proxy_set_header If-Modified-Since $http_if_modified_since; I'm confused. On 26/07/2017 09:11, Peter Booth wrote: > I can’t see an obvious issue, but I caby ryanrbftp - Nginx Mailing List - English
The following config seems to work for the situation I discussed: proxy_cache_valid 200 3M; proxy_cache_valid 304 0; proxy_cache_revalidate on; proxy_set_header If-Modified-Since $http_if_modified_since; proxy_ignore_headers Cache-Control Expires; .... can anybody see any problems with this config or future problems that may arise? On 24/07/2017 16:20, Ryan Barclay wrote: > We have a pby ryanrbftp - Nginx Mailing List - English
That's an interesting solution. Would nginx still cache our other items as normal using this config? We specify cache settings via Cache-Control and Expires headers sent from the origin server. Also, we are using X-Accel-Expires for some pages which are sent from the origin server too. This wouldn't affect any of our caching? It would simply not cache any resources with 304 sent from theby ryanrbftp - Nginx Mailing List - English
We have a pretty simple setup with NGINX sitting on the front and a backend server (on a separate physical server) that provides the content. Nginx then caches content based on the EXPIRES and Cache-Control headers set by the origin server. We noticed that NGINX was not issuing 304 headers to images that were not in the local NGINX cache when the If-Modified-Since header was sent by the clieby ryanrbftp - Nginx Mailing List - English
We have a pretty simple setup with NGINX sitting on the front and a backend server (on a separate physical server) that provides the content. Nginx then caches content based on the EXPIRES and Cache-Control headers set by the origin server. We noticed that NGINX was not issuing 304 headers to images that were not in the local NGINX cache when the If-Modified-Since header was sent by the clieby ryanrbftp - How to...
We are having some trouble setting up NGINX as a reverse SSL proxy cache. We have successfully got everything working except the content caching feature. The caching feature works, and displays a "X-Cache: HIT" header for the second request for a single client - but if a different client tries to access the same resource, they get a "X-Cache: MISS" on their first request.by ryanrbftp - How to...
![]() |
![]() |
![]() |
![]() |
|