IOS6 - How To Clear Cache Of Homescreen/Standalone Web App?
Solution 1:
I can't verify the cache being cleared properly but this worked for me :
In order to do this, you need to allow Web Inspector on your iOS device. Go to Settings > Safari > Advanced > Web Inspector (it has to be active) And you have to activate the developer menu on your computer's Safari. Go to Preferences > Advanced > Activate Developer menu
- Connect your device to your computer with the USB cable
- Go to safari > Developpement > Your Device name > Inspect an App (The app has to be running)
- This will open The inspector on your computer for the web app
- While the inspector is open Clear the cache (command + alt + E)
- With the inspector still open refresh the page on your computer (command + R)
Somehow the Webapp cache got cleared and i got the non-cached code.
Solution 2:
I found a a work-around. Just put a link on the web page itself for users who are having trouble seeing new version...
<a href="javascript:top.frames.location.reload();">refresh</a>
It works just like the iPhone/iPad refresh button on the address bar!
Solution 3:
First plug the phone into the computer then open the web app on the phone and Safari on the computer, then you can open the web inspector in Safari from the menu "Develop>Name of phone>title of app" (if you can't see the develop menu you can turn it on in Safari's preferences).
From there you can see/edit the cookies and local storage just like sites on your computer and pressing command+r while the inspector is focused will reload the app on the phone.
Solution 4:
You can connect your device and open Safari's web inspector on your computer and run document.location.reload()
in the console tab to reload the page.
Before reloading you can press Option+Command+E to make sure the cache is cleared.
Instead of above you can also press Shift+Command+R to reload the page without cache but sometimes it hasn't worked for me.
Solution 5:
Try appending a unique GET tag to the ends of any and all href attributes, for example:
<link rel="stylesheet" type="text/css" href="/css/global.css?
<?php echo(mt_rand(10000000, 99999999)); ?>
" />
This would generate href="/css/global.css?########"
, with a different number nearly every time. This forces iOS' Safari to pull the "new" page down, as there is no data in its cache originating from the same URI, and there likely never will be (unless you plan on reloading the app millions of times during development :D )
Post a Comment for "IOS6 - How To Clear Cache Of Homescreen/Standalone Web App?"