I just started using haproxy (tcp mode because of SSL) to load balance my traffic between two web servers.

When I was using a single server, after images are downloaded for the first time, apache started serving "304 Not Modified" headers. But now I use two web servers and my browser downloads images again everytime I am connected the other web server.

All images on both servers have the same modification date.


You are most likely running into ETag issues. Apache's default ETag for static files is calculated using the filesystem inode #, so if you have two different servers using two different drives, the files will be tagged differently.

Add on each server something like

FileETag MTime Size

at the global level to exclude the inode# from the calculation. Then, just make sure that your clocks are synchronized and the timestamps on all the files are identical and you should be set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.