So we all know by now that all static content for Stack Exchange is kept on sstatic.net.
My question is about the details of the versioning. Let's take a look at the current (as of the time of this question being posted) source to the
master.js file on Stack Overflow (emphasis mine):
The querystring is of particular interest here. The first question is, why is it here?
The assumption is to enable versioning; because all of the content is long-lived (through the use of
Cache-Control: max-age=604800), the assumption is that without such a querystring, the browser would never make a request for the new content if it is updated.
That leads into the second question. Assuming the above assumption is correct, how is the version generated? I'd imagine it would be a PITA to manually create these every time the page is updated, so I assume there is some sort of automated process behind it.
Thinking about it, it would seem to me that you can probably mirror the files on the main SO site (not for serving, mind you) and then generate this timestamp based on the last modified date of the file that is being served up when you write the url.
My guess is that it is not a hash of anything (unless the number of hash values exceeds the number of values being hashed), but rather some sort of encoding.
If so, what is the agorithm that you use to generate these version numbers?
Or am I completely off track here?