Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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