We have a web application (a single page app backed by a REST API) that is mainly used on smart phones. Users are encouraged to create a homescreen icon so that they have easy access and a full screen experience. This worked fine until we decided to release a new version of our application. Some browsers are caching the old version and refuse to refresh the application, even when the user forces a reload.
This is a serious problem when the REST API is upgraded but the browser is still using an outdated version of the web app. We do need the browser to cache things whenever possible, but we also want a reload when a new version has been released.
Now we are considering to use an iframe to fix this problem. We created an index.html that contains an iframe and a small piece of Javascript that does an XMLHttpRequest to the REST-server to figure out the current version. This version is then used to set the src-attibute of the iframe so that the iframe is loaded with the current version of our web application.
The solution seems to work but I was wondering if there isn't a better solution to this problem. Is it acceptable to use an iframe to solve this problem or will it cause other problems (on some browsers/devices)?
Edit: We can't use server side scripting, so auto-versioning is not a solution for us.