Page 1 of 1

Application design to notice code changes

Posted: Tue Nov 15, 2016 6:51 am
by bbanelli
Greetings to all,

is there any "standardized" approach to notify user that local (cached) copy of his SpiderBasic complied software differs from the actual one on web server? Without it, I'm having difficulties communicating with clients by having to repeat constantly - "make sure you Ctrl+F5 to get the newest version of your software".

Re: Application design to notice code changes

Posted: Tue Nov 15, 2016 6:55 am
by Fred
If your webserver is well configured, it should be seemless, as the webserver compares dates before sending new files. You can may be do a recursive 'touch' on all your files when you updload a new version, and ensures your webserver date is right.

Re: Application design to notice code changes

Posted: Tue Nov 15, 2016 8:37 am
by bbanelli
Hi Fred,

I haven't noticed such behavior. :( Newer files on server have changed (younger) timestamp that "old" application but when clicking a link or merely pressing enter in address bar, "old" code remains. It is only Ctrl + F5 that forces reload and new files. Same in Chrome, IE 11 and Edge.

Server is LiteSpeed but IIRC same thing happened in old SB versions with Apache. Server time is properly set.

You can see a short video here: http://youtu.be/dlgZMw7MUO0?hd=1

I have changed title of the window, tried several times "reloading" a link by clicking on the address bar + enter, but only after Ctrl + F5 it actually changed. Times on server, as I've said and you can see it on the video, are just fine.

Thank you in advance for any insight,

Bruno

Re: Application design to notice code changes

Posted: Tue Nov 15, 2016 9:49 am
by cederavic
Hello,
If your server can dynamically serve the html page, you can put a timestamp param in the src of the script
eg :

Code: Select all

<script type="text/javascript" src="spiderbasic.js?timestamp={{sb_timestamp}}"></script>

Where {{sb_timestamp}} is something like 201611151047236 or what you want. The browser cache the file based on the url so if the url change it while update it.
This is what i use got always get and up to date client side version. It works on css too.