Copy link to clipboard
Copied
I'm building an App. The ~/System/Apps/my-app-name/index.html is calling a ~/System/Apps/my-app-name/assets/scripts.js file.
The JS file has a very simple call to echo something in a <pre> element:
It's supposed to be "Not cached." It was "Failed" before I edited it.
When viewing the app in the Manage view, the changes to the file are not shown. It still shows "Failed":
But if I access the file directly (https://my-domain.worldsecuresystems.com/_System/Apps/my-app-name/index.html?preview=True&showLatest...
How do I prevent the Manage view from caching the JS file?
It was driving me crazy too, and I did this -- appended ?v={{globals.site.dateNow}} to the file name. Did that for CSS too, while I am editing, as cache was killing me:
script type="text/javascript" src="/_System/apps/{{appKey}}/_assets/js/app.js?v={{globals.site.dateNow}}"
Copy link to clipboard
Copied
It was driving me crazy too, and I did this -- appended ?v={{globals.site.dateNow}} to the file name. Did that for CSS too, while I am editing, as cache was killing me:
script type="text/javascript" src="/_System/apps/{{appKey}}/_assets/js/app.js?v={{globals.site.dateNow}}"
Copy link to clipboard
Copied
Excellent solution! Thank you.
I had tried adding ?preview=True&showLatest=True to the HTML file call with no luck.
Copy link to clipboard
Copied
Great solution Frisco!
I've always just been opening up the app's iframe in a new tab (most browsers have a "view frame in a new tab" option). Here you can successfully force refresh more easily.
Copy link to clipboard
Copied
Odd, Never have this issue but then as a web developer I have a button on both firefox and Chrome to clear cache quickly and properly. So these sorts of things and need to do extra URL things are not needed.
Empty Cache Button - Firefox
Clear Cache - Chrome
Copy link to clipboard
Copied
I 2nd Liam,
I use Clear Cache now out of habit instead of the chrome refresh button.
Saves a bunch of time. Definitely look into that extension.
Copy link to clipboard
Copied
If you have 'Developer Tools' open in Chrome, you can also access the default cache settings within Chrome by right clicking on the reload button and you will be given these options:
Copy link to clipboard
Copied
That too Dale! Good one.
I use firefox developer edition mainly because its developer tools are just way better in my view and a right click is even to much for me, lol... Click button lazyness with the plugins, hehe.
But yeah.. Really should be no need to do URL date funkyness.. Only systems with server cache modes you may need to do the systems URL parameter to flush cache.