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
Subject Author Posted

Strange problem with cache

florian.iragne October 25, 2012 04:34PM

Re: Strange problem with cache

Maxim Dounin October 26, 2012 06:42AM

Re: Strange problem with cache

florian.iragne October 26, 2012 07:57AM

Re: Strange problem with cache

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

Re: Strange problem with cache

florian.iragne October 29, 2012 03:59AM

Re: Strange problem with cache

Maxim Dounin October 29, 2012 04:40AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 116
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