Hi Andy,

If you want to disable caching of all js files, you can do so by making the 
following simple change to base.htm (starting at line 87 in the current 
default branch):

        require.config({
            urlArgs: "cache_bust=" + Date.now(),
            baseUrl: '{{ STATIC_URL }}js',
            paths: {
                'plugins': '{{ STATIC_URL }}plugins',

The highlighted line is the relevant bit which I added.  It basically just 
does what you described above, that is, it appends a timestamp to the query 
string each time requirejs loads a new file, so that to the browser it 
looks like a different URL and prevents caching (a practice known as 'cache 
busting').

Hope that helps!

- Rob



On Monday, November 16, 2015 at 12:54:07 PM UTC-8, Andy Graham wrote:
>
> A question for the group about the best way to prevent the map page from 
> caching.  We may end up adding or removing layers from the map (added via 
> QGIS server in the layers.js file) every couple of days.  I have found that 
> the layers are cached and new layers don't show up unless I clear the 
> browsing data.  Does anyone have suggestions for how to prevent the map 
> webpage from ever caching so that new layers will show up with a simple 
> refresh?
>
> After some searching I tried adding the following lines to the header for 
> the base.html:
>
> <meta HTTP-EQUIV="Cache-Control" CONTENT="no-cache, no-store, 
> must-revalidate"/>
> <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
> <meta http-equiv = "expires" value = "Wed, 22 Dec 2009 12:00:00 GMT" />
>
> These did not seem to help.  Other suggestions I have found online suggest 
> adding a randomly created number to the link in the html for the .css and 
> .js files which would force the webpage to reload these files.  I am not 
> sure exactly where the link is in the html file for these though and if 
> that would work.
>
> Any help is appreciated.  Thanks.
>
> Andy
>

-- 
-- To post, send email to [email protected]. To unsubscribe, send 
email to [email protected]. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to