Best way to control browser caching of changing js and css files in apache?
<p>We just did a reskin of our website and in aftermath of the deploy, we're having to do a number of small tweaks to the various css and javascript files that control the new look and feel. One of the problems we are encountering is that browsers seem to cache those files and thus a user client may not see some of the fixes we make.<br>
We originally thought of doing something with the mtime of the file and as a 'quick fix' hack, we modified some of the main calls to those files with a url parameter which using server side php to append the latest mtime of the file in question. But this doesn't work as planned because our deploy system clones a git branch and thus, every single deploy ultimately touches every file and alters its mtime. (The end result is, deploying a minor fix ends up telling the client browsers to reload every <code>&lt;LINK&gt;</code> or <code>&lt;Script&gt;</code> tag so modified after a deploy whether the file contents were actually changed or not.)</p>

<p>I was looking at the apache FileETag but it seems to use mtime, size and inode. (I was hoping to find something like a checksum) mtime obviously doesn't work with the deploy method we use and size may not change if alterations don't alter the file's length. I'm not as familiar with how the inode info works, so I'm not sure if that will fit our needs or not.</p>

<p>So I am wondering if anyone has another other suggestions that would tell a client browser to only reload a file if it's contents had actually changed.</p>