Welcome! Log In Create A New Profile

Advanced

NIGHTMARE cache issue reverse proxy. Objects in cache replaced with 0 bytes and not being fetched from upstream

David Taveras
April 12, 2010 10:56PM
Hello,

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:

124.40.68.228 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:1.9.0.19) 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
particular object:

# 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
Server: Apache
Last-Modified: Wed, 30 Dec 2009 17:03:27 GMT
ETag: "104b12-fee-47bf51dfa75c0"
Accept-Ranges: bytes
Content-Length: 4078
Cache-Control: max-age=3888000
Expires: Fri, 28 May 2010 02:32:48 GMT
Connection: close
Content-Type: image/gif



Here is the cache config portion:

## Proxy options
proxy_buffering on;


proxy_cache_min_uses 1;
proxy_cache_path /var/log/nginx/cache_temp/ levels=1:2
keys_zone=cache:10m inactive=10m max_size=512M;

proxy_ignore_client_abort off;
proxy_intercept_errors off;
proxy_next_upstream error timeout invalid_header;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 60;
proxy_send_timeout 60;
proxy_read_timeout 60;

[.......]

proxy_cache cache;



What could be causing this mess???

David

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

NIGHTMARE cache issue reverse proxy. Objects in cache replaced with 0 bytes and not being fetched from upstream

David Taveras April 12, 2010 10:56PM

Re: NIGHTMARE cache issue reverse proxy. Objects in cache replaced with 0 bytes and not being fetched from upstream

Maxim Dounin April 13, 2010 04:28AM

Re: NIGHTMARE cache issue reverse proxy. Objects in cache replaced with 0 bytes and not being fetched from upstream

Ryan Malayter April 13, 2010 08:58AM

Re: NIGHTMARE cache issue reverse proxy. Objects in cache replaced with 0 bytes and not being fetched from upstream

David Taveras April 13, 2010 10:28AM

Re: NIGHTMARE cache issue reverse proxy. Objects in cache replaced with 0 bytes and not being fetched from upstream

David Taveras April 13, 2010 10:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 228
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready