autoreload webpage on new release

Posted by user3726562 on Stack Overflow See other posts from Stack Overflow or by user3726562
Published on 2014-06-10T15:03:53Z Indexed on 2014/06/10 15:24 UTC
Read the original article Hit count: 134

Filed under:
|
|

I have a website in PHP which is completely ajax-based. There is an index.php, but a part from it, all the other page are never rendered directly into the browser. Instead, all the post and get request are done tfrom javascript through ajax. So basically, if you go to /contact.php you will not see anything. All the pages are rendered inside index.php.

So, there are a lot of people that use this page that are not very good in using the web. Asking them to "refresh" the page makes them to wonder what we are talking about. Unfortunately.

The biggest issue happens when we do a new release. Especially the javascript code (but not only) can be the old one in a client's webpage as they maybe havent refreshed the page for some week (lol).

S I do an svn-update and the new code is on the server. I just refresh my page and see the new features.

However, the poor guys that dont really know how to make a refresh, will not see anything. I have added a big button on the page with the text "refresh". Which makes a location.reload. Hopefully this can help a few of them.

But my question is: how to "force" the browser to reload itself when a new svn-version has been released? Hopefully in a simple way, without needing some node.js, javascript timer or stuff like that. It is also quite important to not refresh the page when the user is doing something with the page (maybe writing a mail in the UI, and then suddenly the page get refreshed: not so good).

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about php