iPad won't clear cached web link saved on home screen

I have been developing html5, css and javasript only web app. When accessed to the site and save the link to home screen, it caches the link and any revision made to the site then after will go to the first link even when the old origial html file is removed from the server. Safari's clear history and cache function from the preference only clear the cached items from Safari. Anything saved on home screen remains somewhere on iPad and can not be deleted.


Only way to establish a new link is to change the names of html file, external css and javascript titles and the link to them.


Is there any way to clear all cache on home screen?

iPad 2, iOS 5.1

Posted on Mar 12, 2012 5:55 PM

Reply
20 replies

Mar 17, 2012 11:13 PM in response to manabu nagaoka

It sounds like you created an offline web app with a manifest file. The easiest way to reset it is to press and hold the Home button until the icons in SpringBoard (the home screen) start jiggling, then hit the "X" next to the web app's icon. This will delete the web app, then you may re-save it from Safari again.


The other way to update the resources (or the contents of the main HTML page--but not the URL to the main page itself) is to update the manifest file with a new version, launch the web app from SpringBoard (while connected to the Internet), then hit the Home button again. The second time you launch the web app, the updated resources should appear.


This is how offline web apps work. Here's some resources you may find helpful:


http://www.w3.org/TR/offline-webapps/

http://developer.apple.com/library/safari/#documentation/iPhone/Conceptual/Safar iJSDatabaseGuide/OfflineApplicationCache/OfflineApplicationCache.html

http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Referenc e/SafariWebContent/Client-SideStorage/Client-SideStorage.html

Mar 18, 2012 6:29 AM in response to ddkilzer

Thanks for info. I did try all of these but none worked. After reading some other similar postings, I still believe this is a bug. The issue occurs when you save the link from Safari to homescreen. You can delete the icon and re-save from Safari. While it is perfectly okay on Safari, once saved on homescreen and launch from it, it goes back to the old link that does not even exisit on the server.


Only solution I found so far is to go to Setting and Safari setting. Under Privacy, choose Accept Cookies as "NEVER" and clear all History, Cookies and Data. Go back and launch Safari and open the URL and save to homescreen. This deletes the old cookie and allows for new link. You may turn on the cookie in the setting to allow "From Visited" to have quicker access for later use. However, you need to repeat this when you change your content and want new link to appear.

Mar 18, 2012 8:42 AM in response to manabu nagaoka

The cookie store is shared between Safari and offline web apps, so any web app needs to be designed with that in mind.


The other rule when making an offline web app is that the URL that the web app is saved from must always exist. It's usually best to have the "main" HTML page be static, and have it load all of its content via XMLHTTPRequest and/or build the page using the DOM API in JavaScript (e.g., using document.createElement() and then append the result to the page).


If you still feel this is a bug, I suggest filing a bug report using <https://bugreport.apple.com/>. Use your existing Apple ID to log in. If the site asks you to sign up as a developer, make sure to choose the free option. (It will likely be at the bottom of the page, so make sure to read all the options and scroll down.) Please provide a complete test case (server side files that can be deployed to an Apache web server, preferably), as well as complete steps to reproduce the bug. It would also be helpful to report the 8-digit bug number here once it's filed.

Apr 4, 2012 12:57 PM in response to ddkilzer

I have been testing other things as well. But, it turns out the above method does not always work. Only way to do this right is to save javascript and css in different names, and create new links to them on html page. It appears "images" tend to stay on screen even when they are removed and placed in different folder. It could be javascript or css issue, but I do doubt that.

Sep 6, 2012 7:47 AM in response to manabu nagaoka

I am experiencing the same problem. I have an Original iPad and a New iPad (both current on OS updates). After replacing an image for a web page, the new image shows up on Safari (and Chrome) but after I "Add to Home Page", the old image displays. I have performed all of the following to correct but no luck on my Original iPad:

1. Close all Safari Tabs

2. Clear Safari History

3. Reset Safari - Hold Power button and until slide to power off and then hold hold home button until Safari closes

4. Deleted the EVERY Web App icon on the Home Screen that references that Website

5. Settings -> Safari -> Clear History

6. Settings -> Safari -> Clear Cookies and Data (All Website Data should now be cleared

7. Stopped EVERY task in the multitasking list

8. Powered OFF the iPad

9. Stopped my Apache Web Server and cleared all logs

10. Started Apache Web Server

11. Started the iPad

12. Open Website in Safari and New image is displayed

13. "Add to Home Screen"

14. Exit Safari

15. Open Web App from icon on Home Screen


OLD IMAGE IS DISPLAYED


16. Viewed Safari Access Log and confirmed that the New image is retrieved as it is twice the sixe as the old image. Apache had 2 references to my image file the first resulted in 200 RC and 41232 file size and the second log line resulted in a 304 RC which means it had not changed and pulled from cache.


NOW I change the IP Address of my Apache Web server, open Safari and go to the new IP Address Web Site (that has all the same unchanged files, content etc.) and the NEW image is displayed as expected. I then "Add to Home Screen", close Safari, OPEN the Web App from the Icon on the home screen and the NEW IMAGE IS DISPLAYED CORRECTLY.


I would say this appears to be a bug and as a result the Bank I work for has suspended iOS based application rollout because this implies that sensitive customer data may be cached unexpectedly.


Please escelate to severe defect!

Nov 6, 2012 12:46 PM in response to HugoStOnge

HugoStOnge wrote:


I am too developing a web app, and I have the very same problem, on both original iPad and the new iPad (3).


And as Rian M. stated, this issue can pose a serious security risk.


Apple, are you listening ?!?! This issue is critical and must be fixed ASAP ! 😠


This forum isn't suited for reporting specific bugs. Please consider using https://bugreport.apple.com/ to report a specific bug, and attach a self-contained test case to the bug if at all possible.

May 3, 2013 1:32 AM in response to manabu nagaoka

I got the solution!


But first the problem: iPad and iPhone is not refreshing the cache when opening the app. Even deleting the app, clearing safari cache, restarting device etc. etc. doesnt work.


And here is the solution ... taadaa !


Your manifest-file MUST change. If it is changed, iPad/iPhone will reload the cache. So just write a version number in your manifest file and change it when you changed something:


# Version: 1.2


So a full manifest file could look like this:


CACHE MANIFEST


# Version 1.5

NETWORK:

*

CACHE:

index.html

jquery-1.7.2.min.js

images/logo.jpg

It even reloads things like images that are not written into the manifest file. I tested it a several times.


Btw. dont forget to check your manifest-file with http://manifest-validator.com


My source is this very cool how to about offline web applications: http://gregsramblings.com/2012/05/28/html5-application-cache-how-to/


It also says that you maybe need to start your app twice:

If the manifest was updated, the browser will download all of the files in the cached file list, BUT, the original content will have already loaded at this point (remember that it’s already cached, so it loads super fast!).


But it worked for me always on first attempt.

Jul 5, 2013 3:46 PM in response to manabu nagaoka

One possible solution

I load my javascript/css/html content (other than a main index.html/js file) from javascript and add it to the dom tree. I had the same problem with the ipad (and I think iPhone) icons continually loading the old content. I think one solution that seemed to work is to append a timestamp to the end of each filename as i request it, such as: sample.js?ts=122332222 . This seems to force the new fetch. The downside is that you will never cache items so if your app is going to be deployed, you may want to remove this as a final step. I also notice a similar problem on android phones.

Oct 22, 2014 1:41 PM in response to manabu nagaoka

Exact same problem here on IOS 6.

A Home Screen WebApp caches pages using a manifest.appcache while online. Turn off WiFi and you can re-launch and still see all the pages.


But, turn WiFi back on, update the manifest contents and some pages, and no new manifest is fetched from the server, leaving you with stale pages. Only way out is to delete Safari Cookies & Cache, delete the home page icon, and start over.


Definitely a bug because on the same device using the same online/offline manifest change:

Chrome Works!

Mercury Works!

So sad..😟. Safari loses to Chrome and Mercury.

Interesting thing is the network spinner spins, but Apache never logs a file request from Safari.


BTW, also set mime type manifest cache to zero.

-edit- Even without using the Home Screen icon, Safari still refuses to read the new manifest.

Oct 4, 2015 6:54 AM in response to mattman2005

Hi,

My problem is a bit different. I have a cookie which causing an infinite redirection loop which causes an error "too many redirections" and allows me only to close the app.


I tried all the "regular" ways to clean the cookies but it doesn't clean the cookies on the web apps on the homescreen. Then, I wrote a js to delete the cookie when the page is loaded. It doesn't work too. I tried to download cleaners applications, it doesn't helop too. I also tried to change the manifest but those resources are not the problem, the cookie is the problem.


My problem is that I have 2 users (clients) with that problem, beside resetting their iphone (cannot be requested...) or changing my app url (there's got to be a better way), I don't see any other solution.


Any ideas for me?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

iPad won't clear cached web link saved on home screen

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.