Question

$script.ready('jui',function() { 
$script('<?php base_path(); ?>js/partnerScripts.js?ts=1315442861','partners');
}); 

And why tag a fixed ts=timestamp? thing to the end of name of partnerScripts.js? I search inside the folder but only found that file without the ts=xxxx. What's the purpose of that in the code. That number is fixed and it's like a real timestamp anyway?

Was it helpful?

Solution

This is generally done for "cache busting" on different versions.

If you want users to cache the script indefinitely, but still want to easily update it in the future, you just have to update the timestamp. This effectively makes it a new URL/resource, but you can keep your files in the same place.

And yes, that timestamp is valid, and is from September 2011. It's the number of seconds since midnight, UTC, January 1, 1970.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top