just bumping this incase the one person who might know the answer missed it first time round...I can't imagine I am the only person who's noticed the problem?
I don't hink is much that can be done about it. If you are testing then it will be an awarness approach. Noramlly, its not something a 'live'/public location will need to do since its often a post once routine. Also the browsers inability to 'refresh' reources is often due to working in the same browser session.
i know two ways to prevent browser from caching your files
First : The Hard way
just add ? +Math.random() in the end of your file
Like this :
in HTML :
var e = document.getElementsByTagName("script");
var d = document.createElement("script");
d.src = "index_edgePreload.js?"+Math.random()+"";
d.async = true;
d.defer = true;
instead of this Line in HTML that created by EA :
Disadvantage : you should do this for all of files you want to prevent from caching
Second : The easyest way
You Should have Access to .htaccess file in your Server
Open your .htaccess file and paste these codes in it :
ExpiresByType application/json "access plus 1 seconds"
ExpiresByType text/json "access plus 1 seconds"
ExpiresByType text/plain "access plus 1 seconds"
ExpiresDefault "access plus 1 month"
you can type what ever type of file you want to prevent from caching in browser
Advantage : after do this in your .htaccess file all files with the type you want will not Cache in your browser
Easy is'nt it ?
I completely understand that, and that would be fine I imagine for most projects. The real problem for me is the client needs to edit the html pages (which will be done via a cms service) that are being inserted into each content page inside edge . However, despite the meta no cache tags in these files, they refuse to update after being edited. I presume this is because they are being absorbed into the main page via js on loading. Since these pages contain vital info that needs to be up-to-date (such as price lists) it is imperative that the end user sees the latest version. Hence my anxiety over this. The killer here is that even closing the browser session for me didn't do the trick.
Zaxist, you're a star! Love the htaccess solution!
I love it too !!
Just a note when using the htaccess solution. Ensure you clear your browser cache first before seeing the effects. I was thinking it wasn't working until I did this.
Funny you had to clear the cache even with the htaccess soltion