NIGHTMARE cache issue reverse proxy. Objects in cache replaced with 0 bytes and not being fetched from upstream
d3taveras38d3 at gmail.com
Tue Apr 13 06:50:34 MSD 2010
I have enabled caching, and now when I visit my page and I hit the
Shift key so that I force my browser to not use the local cache and
fetch all objects intermittently (happens randomly for objects) some
of the objects after 1 or 2 refreshes with this method become 0 size.
After I "screw" the cache of nginx with this shift key the only way to
get a full page to load with all its objects is to clean the cache and
send a kill -HUP to the nginx pid .. or rm -fr the cache contents
directory and reboot the server.
When I look in the logs I see this:
126.96.36.199 www.mydomain.org - [08/Apr/2010:17:47:34 -0600] "GET
/images/split_main_footer.gif HTTP/1.1" 304 0
"http://www.mydomain.org/products.php" "Mozilla/5.0 (Windows; U;
Windows NT 5.1; es-ES; rv:188.8.131.52) Gecko/2010031422 Firefox/3.0.19
(.NET CLR 3.5.30729)" "0.000"
NOTICE the 304 response code given to me.. with a 0 byte size.
If I go into the server I can fetch the object from upstream with lynx
(no object is ever 0 size). This is the result of the header of that
# lynx -dump -head http://www.mydomain.org/images/split_main_footer.gif
HTTP/1.1 200 OK
Date: 08 Apr 2010 17:48:48 GMT
Last-Modified: Wed, 30 Dec 2009 17:03:27 GMT
Expires: Fri, 28 May 2010 02:32:48 GMT
Here is the cache config portion:
## Proxy options
proxy_cache_path /var/log/nginx/cache_temp/ levels=1:2
keys_zone=cache:10m inactive=10m max_size=512M;
proxy_next_upstream error timeout invalid_header;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
What could be causing this mess???
More information about the nginx