Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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.

Apr 11, 2012 5:20 AM in response to iOS Subject Matter Expert

I have been trouble shooting this issue for sometime, going back to each line of code. It appears that this is related to external css and JavaScript and internal ones and where they are placed. Simple websites with no css or JavaScript won't be affected by this, for example. Will post progress when something definitive is found.

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.

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 ID.