Select to view content in your preferred language

Automate Cache Clearing - Web App Builder

9757
3
Jump to solution
02-19-2016 10:43 AM
LangdonSanders2
Frequent Contributor

Is there a way to force Web App Builder to not store app data or to clear it regularly?

Troubleshooting WAB often involves clearing the browser cache. This is not ideal for multiple users, sites, and permissions. A recent example is layers not showing in the table of contents and other odd behavior until the cache is cleared.

  • Ideally we want users to view the application as if they were in "Incognito Mode"

Ideas

We currently deploy apps through the WAB developer edition in Portal so we are able to make changes to configuration files, add code as needed, or change web server settings.

  • Is there a setting in the WAB configuration files to achieve this result such as through headers or the manifest?
  • Perhaps this could be accomplished through the web server?

Your thoughts are appreciated.

Thanks.

0 Kudos
1 Solution

Accepted Solutions
SamLibby
Esri Contributor

I would recommend setting custom headers in your web server (where the app is hosted) which will force no-cache on users. Note that this will negatively affect their experience of the app as load times will be increased following the first load vs. normal cache behavior. This SO post covers it pretty well;

http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers

Be sure to only add these custom headers for your WAB apps, not the entire web server, so that Portal assets are not set to no-cache as well.

View solution in original post

3 Replies
SamLibby
Esri Contributor

I would recommend setting custom headers in your web server (where the app is hosted) which will force no-cache on users. Note that this will negatively affect their experience of the app as load times will be increased following the first load vs. normal cache behavior. This SO post covers it pretty well;

http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers

Be sure to only add these custom headers for your WAB apps, not the entire web server, so that Portal assets are not set to no-cache as well.

LangdonSanders2
Frequent Contributor

We are going to explore this option and I'll report back what we implement. We may end up setting an expiring cache rather than prohibiting them completely.

0 Kudos
ChrisRice2
New Contributor

You may reference the below technet article for further guidance on configuring the HTTP expires response header. This is assuming, of course, that you're using IIS.

Enable the HTTP Keep-Alive Response Header (IIS 7)