I’ve consistently not been able to find a way to reload data to the browser.
For example in FF 10 – Hitting Control-Shift-R is suppose to do this. Sometimes it does, some times it does not.
I’ve read that if you change the URL of the requested resource the browser will re-load the data as new. I believe this. I’m going to implement it.
What I’m going to do is simply us PHP to change the file name by appending a unix time-stamp to it. This will be done on each resource request.
I’m planning on writing a PHP maintenance script ( say updateResource.php ) that renames the resource and at the same time writes PHP code that sets the name into the PHP script.
so for my .js resource
file1.js
becomes
file1_timestamp.js
and
the contents of php file go from
$file_name = file1.js
$file_name = file1_timestamp.js
PHP later writes to .htm file which javascript then knows to pull from the DOM and load the file dynamically via Ajax Call.
And this time it is not cached b.c. the URL changed.
Is this a good way to guarantee reloads?
To force client side reload,
script.ts?v.xxworks well and is widely used. Replace xx with the current release of your application at compile time. This way you wont have to rename the file.