Select to view content in your preferred language

Refreshing Web Appbuilder

13110
16
Jump to solution
05-06-2015 03:43 PM
StanMcShinsky
Frequent Contributor

What is the best way to update web app builder for the end user? When I put out a new version of WAB I don't want to have the end user clear their cache (most don't know how or will forget). Is there a snipit of code to place in the html file or something that will tell the browser to get the latest version?

-Stan

0 Kudos
16 Replies
Drew
by
Frequent Contributor

Hello Florian,

If you wish to test it just add it on an application by application basis.

If you find it works as you expect you can add it to the "stemapp" and it should get copied over for every application you create.

Generally speaking, it just appends a date onto the HTTP Request URL to trick the browser into thinking it's a new file.

If you know how to use your browser debugger you can preview it live in our map.

Andrew

0 Kudos
FlorianCADOZ
Regular Contributor

Yes, I tried it and it worked well (Speaking of that, thank you for this trick!), but I would like to understand two things :

- First, if you concate the filename with the date, does it mean that your file don't gonna be updated two time in the same day ?

- Second, do you know/imagine the limits/risks of this manipulation ? Why it doesn't work with the WAB 1.3 ?

Thank you

Florian

0 Kudos
Drew
by
Frequent Contributor

Florian,

To answer your questions...

  • If you concate the filename with the date, does it mean that your file don't gonna be updated two time in the same day ?
    • The date is down to the second, so it should be a unique number every time you reload the page (on the server defined (myHostName), therefore a unique URL too.  There is one exception; the date is down to the "day" only if the app is loaded your development box (this is why myHostName has to be defined)

  • Do you know/imagine the limits/risks of this manipulation ? Why it doesn't work with the WAB 1.3
    • I don't see any limitations to this. I have not tested it on 1.3 yet and ESRI could have changed their WindgetManager.js file in that version.
    • If i have time I will try and get 1.3 and modify the file to work the same - then post it here.

Hope that helps answer your questions.

Andrew

FlorianCADOZ
Regular Contributor

Andrew,

Yeah I understand the timestamp format that allow us to generate an unique ID but by my side it make something like this :

Sans titre.png

0 Kudos
Drew
by
Frequent Contributor

Yes that is correct when the site is loaded on a domain that is NOT the one defined in the myHostName variable.

I had to do this because I was not able to debug files in the browser if the file name was changing every time I reloaded the app.

If the site is running on the host name defined in myHostName it should look similar to the image I posted originally.

Hope that makes sense.

Andrew

FlorianCADOZ
Regular Contributor

Oh sorry ! I just understood my mistake ! I didn't take care that it was the domain and not the complete URL !

Thank you very much for your help !

0 Kudos
Drew
by
Frequent Contributor

Ya, that part makes it a little confusing but its needed to be able to debug in chrome or else chrome thinks it's a new file each time and all your break points no longer load.

If I do another version make I can make it automatic where I look for port :3344 to detect if its dev or not. we will see

Glad it's working well for you.

Andrew