Caching issue - webappbuilder

558
4
04-07-2020 08:39 AM
KafilBaig
New Contributor III

When I change the widget.html or widget.js of any custom widget. There is no change in the application unless and until I clear the browser cache. Is anyone facing the same issue . Please let me know . 

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Kafil,

  What is the path of the widget.js/.html file that you are editing?

0 Kudos
KafilBaig
New Contributor III

https://myservername.org/myapplicationname/widgets/ebind/widget.js

I am directly editing in the my application widget folder.

On Tue, Apr 7, 2020 at 9:31 PM Robert Scheitlin, GISP <geonet@esri.com>

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Nope, I have not seen that issue before then.

0 Kudos
KafilBaig
New Contributor III

I added a input button and javascript function in widget.js and saved it. Now when i try to see the changes in my application hosted on IIS it is not taking the new changes unless i go n clear the cache.

i tried to add the below code in jimu.js/widgetmanager.js as per one of the thread https://community.esri.com/thread/158241 

var myHostName = "maps.simcoe.ca"

var uid = Math.floor(Date.now() / 100000)

if (window.location.hostname.toLowerCase() != myHostName)
{
var d = new Date();
uid = d.getFullYear().toString() + "-" + (d.getMonth() + 1).toString() + "-" + d.getDate().toString()
}
this.preventCacheParameter = "?preventCache=" + uid;

Let me know what is the best solution or workaround i can implement to get rid of this issue.

Thanks In Advance.

0 Kudos