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
The setup is in active-active mode.
When i load a page with no browser cache, each item in the static
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
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
nginx is serving the files. In this setup, the ressources are always
with a 304 answer.
Did i miss something? I assume that my servers setup is quite common,
d’ont believe that the behaviour i observe is “normal”.
Posted at Nginx Forum: