I'm looking at the source of a page and I'm seeing this:
<script type="text/javascript" src="tsp.js?1347090849"></script>
What is this number appended to the src? 1347090849
I'm looking at the source of a page and I'm seeing this:
<script type="text/javascript" src="tsp.js?1347090849"></script>
What is this number appended to the src? 1347090849
You can do that to prevent the browser from loading a cached version of the file.
To the browser, that looks like a different file than the last time it was loaded. Every time the page loads, the number should be different, so the browser will request it from the server again instead of loading it from the cache.
The number doesn't have to be different each time. You can change it when you update the file so clients can load the cached version until you update it, after which, because it has a different number, they'll request the new version and cache that.
Related: How to append timestamp to the java script file in tag url to avoid caching shows you how to do it dynamically to your scripts.
That number is simply used to force a cache refresh on the script being requested. As a different query string could result in different page content, browsers must assume that each different query string is a completely new page.
Developers can take advantage of this by appending a timestamp or random number as the query string to force the page to re-request the script.
filename.js?0 <-- browser requests this one and caches it
filename.js?1 <-- browser must request this one because it might be different
The number that you posted in particular (1347090849
) evaluates to Sat, 08 Sep 2012 07:54:09 GMT
if it's treated as a timestamp. I'd guess that that was the date of the last time the file was changed.
It is just a identifier to make sure that the client gets the updated script file everytime they change the number.