I am using JQTouch to create a Web App on the Homescreen using meta tag "apple-mobile-web-app-capable", but no matter how many times I clear the cache from within Settings, the Web App's Javascript is still an older cached version.
Strangely enough, if I set the meta tag's content to;
<meta name="apple-mobile-web-app-capable" content="no" />
...then add the Web App to the Homescreen, I get the latest version when I launch it.
Yet if I set the meta tag to;
<meta name="apple-mobile-web-app-capable" content="yes" />
...then add the Web App to the Homescreen, I get the older cached version.
PS. I can confirm that is only the javascript which will not refresh.
To delete the site Cache storage of some specific sites from Safari iOS, you need to open the Settings>Safari App>Adavnced> Website Data. Now, in the Website Data, tap on edit and then select the specific sites whose site storage you want to delete and then tap on delete.
Tap Clear data to clear app data and cache. You'll then have to select whether you want to clear all data associated with the app or just its cache. Clearing data will automatically clear the cache of the app as well.
You could try adding a unique string to the end of your js include's src attribute (use a timestamp, for example). Bear in mind you'll have to change this unique string for each refresh you want to do, so you may want to consider doing lazy-loading (which may in itself solve your problem): <script type="text/javascript" src="myScript.js?012345"></script>
This usually forces the browser into grabbing the latest version of the script. Might work...
This is a way that worked for me to clear completely the cache:
1-Delete the tabs in safari where there is your app.
2-Delete the icon of the app in the home screen.
3-Kill safari from the memory.
4-Go to settings/safari and press clear cache.
5-You can restart your iPhone/iPod if you want to be sure that it works
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With