numbers that append href links to stylesheets and javascript files
I keep noticing that some websites have numbers appended to the end of the refering to a stylesheet or refering to a javascript file.
example:
print.css?1232495530" media="print" rel="stylesheet" type="text/css" />
ga.js?1232495530" type="text/javascript">
This obviously looks dynamic but what is this for - i can a stylesheet be dynamic and how can a javascript file receive what looks like parametres in the URL?
Any explanation appreciated.
greg posted this at 13:08 — 21st January 2009.
He has: 1,581 posts
Joined: Nov 2005
This might get you on the way..
http://www.alistercameron.com/2008/09/10/smart-cache-busting-for-your-wo...
Greg K posted this at 13:30 — 21st January 2009.
He has: 2,145 posts
Joined: Nov 2003
As the link probably explains it is to get your browser to grab a fresh copy instead of using a cached version.
The numbers at the ends are usually just random numbers so each load of the page (if it isn't cached itself LOL) will most likely grab a fresh copy from the server.
-Greg
jitendraag posted this at 13:48 — 21st January 2009.
He has: 5 posts
Joined: Jan 2009
1. Browser is expected to request for the js or css script instead of caching it when a new session is loaded, allowing for newer versions of scripts to be loaded.
2. The javascript 'may' be used to point to a specific state in an AJAX page.
Manual Directory Submission || Directory List
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.