Welcome! Log In Create A New Profile


nginx serving old files from cache

April 18, 2012 06:09AM
I have nginx set as reverse proxy for Apache and for serving static files.
Everything works great, except in the last few weeks I noticed that sometimes nginx returns page from cache which is 3-4 hours old. I checked the timestamp of the cache file, and it is old.

This is part of the config file related to caching in nginx.conf:
proxy_cache off;
proxy_buffering on;
proxy_buffer_size 8k;
proxy_buffers 100 8k;
proxy_cache_path /var/www/cache levels=1:2 keys_zone=my-cache:8m max_size=1000m;
proxy_temp_path /var/www/cache/tmp;
proxy_cache_key "$host$request_uri";
proxy_ignore_headers "Expires" "Cache-Control" "X-Accel-Expires";

and this is for particulat vhost:
proxy_cache my-cache;
proxy_cache_valid 200 404 1m; # <----- should be valid for just one minute!
proxy_ignore_headers Expires;
proxy_ignore_headers Cache-Control;
proxy_ignore_headers X-Accel-Expires;
proxy_ignore_headers Set-Cookie;
proxy_hide_header Set-Cookie;

Any ideas?
Subject Author Posted

nginx serving old files from cache

VRider April 18, 2012 06:09AM

Re: nginx serving old files from cache

Brian Akins April 18, 2012 10:04AM

Re: nginx serving old files from cache

VRider April 18, 2012 10:50AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 124
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready