iOS6 - How to Clear Cache of Homescreen/Standalone Web App?

前端 未结 9 841
悲&欢浪女
悲&欢浪女 2021-02-01 05:11

It would appear that Apple have changed the way homescreen/standalone web apps work in iOS 6. According to various blog posts (example) these apps now get their own dedicated s

相关标签:
9条回答
  • 2021-02-01 05:42

    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!

    0 讨论(0)
  • 2021-02-01 05:46

    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 )

    0 讨论(0)
  • 2021-02-01 05:53

    This drove me nuts for a while. Tried clearing the cache on device - no luck. Renaming the page did help, but once you rename it back, you still get the same stale version. Found the solution yesterday. You need to connect your device to Mac and open Web Inspector in Safari Develop menu. Once in Web Inspector, simply press "Reload page" button on the Inspector's toolbar and - voila - you see the fresh version on your device's screen.

    0 讨论(0)
提交回复
热议问题