[Xerte-dev] Browser caching and problems it causes with each update
Tom Reijnders
reijnders at tor.nl
Sat Feb 20 12:18:09 GMT 2016
Hi,
I've had several instances where we had a sudden increase of support
calls after installing an update of XOT (i.e. from 3.0 to 3.1)
Most of those were due to caching issues. i.e. new modelfiles were used
against a previous cached version of xenith.js
There are several solutions to this:
1. At a timestamp in the url that loads xenth.js , ie
src="xenith.js?_=<?php echo $timestamp;?>" or similar
The drawback of course is that xenith.js (and similar files) are not
cached anymore, increasing the time needed to load an LO
2. Add a version to the filename of xenith.js, i.e. everytime something
changes in xenith.js, change the version.
This is the approach used by a lot of javascript libraries, cf. jQuery.
But it it's painfull, and errorprone (or we have to have a build process).
3. An interesting variation could be the combination of 1. and 2.
We have a version string maintained in the file version.txt in the root
folder of the installation. This file is automatically updated when
publishing zips for the community websites. We could add
?version='<contents of version.txt>' to all the files we want to reload
after a new release, such as xenith.js
Tests show that this works fine ans as expected. I would like to
implement 3.
Any objections, remarks, other solutions?
Tom
--
--
Tom Reijnders
TOR Informatica
Chopinlaan 27
5242HM Rosmalen
Tel: 073 5226191
Fax: 073 5226196
More information about the Xerte-dev
mailing list