简体   繁体   中英

IPad Web App- Homescreen Icon Not Updating

I've got a webapp that works best when it's added the homescreen as and icon and launched like a native app. It works well except I can't get the JS to update on it. I've tested it on the web (fine). Deleted the icon and placed it back on the homescreen. Cleared the web data. I can't get it to use the new JS. Any ideas?

WebKit for iOS caches the files and sometimes it's buggy. Delete and reinstall the webapp, clear Safari's cache, history, HTML5 storage etc. in Settings, even try rebooting your device.

I spent several hours trying to fix this problem, and it seems as though the manifest file that is supposed to manage file caching, can itself be cached, leaving your web-app in limbo.

In my case, I didn't want anything cached. Here's how I solved the problem:

  • Enable the mod_expires Apache module on my server
  • Create a .htaccess file in the same directory as the index file. The file should contain the line ExpiresDefault A1 .

This tells the server that every file should expire one second after it was accessed. My web-app is used as a survey at student conventions, so only one person is using it at a time. My solution works for me; you might need to tweak it further so it suits you.

In the past, this problem had presented itself seemingly at random. All of my recent testing has shown it to respond as one would expect.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM