MashZone NextGen 10.2 | Appendix | Legacy Presto components | Apps and Workspaces | Custom Apps | Override Browser Caches for Updates to App Resources
 
Override Browser Caches for Updates to App Resources
When you update the resource files for customized basic apps or fully custom apps, testing in the App Editor shows the update. However, users may still report problems or see old content because browsers use cached versions of the resource until the cache expires or users manually clear their browser cache. Having users manually clear their browser cache is generally not an acceptable solution.
You can manage browser caching to ensure that they retrieve updated resources for customized or fully custom apps by using the version attribute in the <require> statement in the App Specification.
Note: This attribute has two different meanings for resources depending on whether the resource is a named library bundled in MashZone NextGen or it is a resource upload within a custom app. See the <require> topic for more information.
The MashZone NextGen App framework uses this metadata to append a unique string to the URL used to retrieve that resource for a custom app. Setting this attribute or updating it each time you update a resource ensures that the URL is unique so that browsers always retrieve the updated file.
For this initial example:
<app id="SampleTable" name="SampleTable"
jsclass="Sample.HelloWorld" height="200" width="200"
draggable="false" minimizable="false">
<title>SampleTable</title>
...
<requires>
<require src="js/app.js" type="script" version="1"/>
<require src="css/app.css" type="css" version="1"/>
<require src="html/app.html" type="html" version="1"/>
</requires>
</app>
If you update the JavaScript class for this custom app, you simply also change the App Spec to this:
<app id="SampleTable" name="SampleTable"
jsclass="Sample.HelloWorld" height="200" width="200"
draggable="false" minimizable="false">
<title>SampleTable</title>
...
<requires>
<require src="js/app.js" type="script" version="2"/>
<require src="css/app.css" type="css" version="1"/>
<require src="html/app.html" type="html" version="1"/>
</requires>
</app>
To ensure your changes are visible to all appropriate users in MashZone NextGen Hub. You may also need to publish the app to the AppDepot to make your changes visible to users in the AppDepot or the MashZone NextGen Mobile apps.

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release