Mobile Web App not clearing cache properly

后端 未结 10 710
醉酒成梦
醉酒成梦 2020-12-13 06:29

I\'ve been developing a mobile web app for iPad and I\'ve been running into an issue while testing my code.

Occasionally, and seemingly at random, the iPad will st

相关标签:
10条回答
  • 2020-12-13 07:09

    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

    1. Connect your device to your computer with the USB cable
    2. Go to safari > Developpement > Your Device name > Inspect an App (The app has to be running)
    3. This will open The inspector on your computer for the web app
    4. While the inspector is open Clear the cache (command + alt + E)
    5. 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.

    0 讨论(0)
  • 2020-12-13 07:11

    I had the exact same problem.

    I tried the different suggestions here, and added cache control with no luck. I tried renaming the file that refused to update, no luck. I tried adding a cache manifest (I had one before, but removed it), no luck. And I tried all the usual things: delete app, clear cache, reboot, reinstall app, no luck.

    The only thing that worked for me, was to rename the virtual directory on my web server. This might not be a viable solution for everyone, but luckily for, this was not really a problem, as I'm testing using a local IIS server.

    0 讨论(0)
  • 2020-12-13 07:14

    For me, the solution is adding ?v=1 at the end of all your Javascript and CSS links. I've tried everything before seeing that on another Stackoverflow post and it worked directly !!! It was about time...

    0 讨论(0)
  • 2020-12-13 07:15

    I'm having exactly the same problem with my web applications on iPad - sometimes, at random, the web app run in standalone mode wouldn't refresh a particular resource (HTML/CSS/JS file), despite killing every possible app, clearing Safari cache & history, rebooting, restarting wifi-connection, refreshing or removing the manifest file or putting the device in a microwave; even applying a sledgehammer proved to be futile.

    While I haven't found a "kosher" way to fix it, there is always a workaround - rename the resource.

    Simply change the name of the not-refreshing file. If you have a problem with, let's say, foobar.js not updating, rename it to foobar2.js and update the references to this resource in other files. This of course could be a pain in you know what (especially when after a week's worth of development you are at foobar12.js), but until we see an official fix to iOS or a working refreshing technique, it's the only way I know of to get it up and running.

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