Welcome! Log In Create A New Profile

Advanced

Strange problem with cache

October 25, 2012 04:34PM
Hi,

i've come accross a strange problem of caching. My site is run by nginx 1.2.1, on two different servers. The config are exactly the same (i use puppet to mirror configs). The contents are exactly the same, everything that i can think of is exactly identical on both servers.

In the config, i set "expires max" for the /static location.

The two nginx are behind a haproxy instance for loadbalancing and failover. The setup is in active-active mode.

When i load a page with no browser cache, each item in the static location is served by nginx with the correct response regarding the max-age and expire directives. Then i reload the page : some of these ressources are served with a 304 response (that is the expected behaviour), some with a 200 code (hence, a fresh copy of the file). If i reload the page again and again, the ressources served with 304 answer are varying.

Now, i've put the server into active-backup mode, and only one instance of nginx is serving the files. In this setup, the ressources are always served with a 304 answer.

Did i miss something? I assume that my servers setup is quite common, and i d'ont believe that the behaviour i observe is "normal".

Any idea?

thanks

Florian
SubjectAuthorPosted

Strange problem with cache

florian.iragneOctober 25, 2012 04:34PM

Re: Strange problem with cache

Maxim DouninOctober 26, 2012 06:42AM

Re: Strange problem with cache

florian.iragneOctober 26, 2012 07:57AM

Re: Strange problem with cache

Oleksandr V. Typlyns'kyiOctober 27, 2012 08:38AM

Re: Strange problem with cache

florian.iragneOctober 29, 2012 03:59AM

Re: Strange problem with cache

Maxim DouninOctober 29, 2012 04:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 79
Record Number of Users: 5 on November 26, 2014
Record Number of Guests: 173 on November 26, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready