• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

How to stop BC Apps caching JS files in Manage view.

Community Beginner ,
Apr 14, 2017 Apr 14, 2017

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:

Screen Shot 2017-04-14 at 9.24.36 AM.png

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":
Screen Shot 2017-04-14 at 9.24.14 AM.png


But if I access the file directly (https://my-domain.worldsecuresystems.com/_System/Apps/my-app-name/index.html?preview=True&showLatest...

Screen Shot 2017-04-14 at 9.24.23 AM.png

How do I prevent the Manage view from caching the JS file?

TOPICS
Developer

Views

435

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Apr 14, 2017 Apr 14, 2017

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}}"

Votes

Translate

Translate
Engaged ,
Apr 14, 2017 Apr 14, 2017

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}}"

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 14, 2017 Apr 14, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 17, 2017 Apr 17, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 17, 2017 Apr 17, 2017

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 18, 2017 Apr 18, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 18, 2017 Apr 18, 2017

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:

Screen Shot 2017-04-19 at 08.41.19.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 18, 2017 Apr 18, 2017

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines