I'm trying to debug a site on my iPhone4 (iOS4) iPad1 (iOS3.3) and desktop.
My problem is I cannot clear the iPhone cache at all.
If I add alerts/consoles to the js files I'm debugging, they show up on iPad and desktop, but the iPhone just keeps reloading from the cache.
If I clear the cache through settings>safari>delete browser history, cache, cookies
and in Safari delete all bookmarks and remove the files on the server, iPad and desktop break (missing files) but the iPhone still loads the page as if nothing happened.
Not sure this is the right place to ask, but maybe someone else has a similar experience and an idea how to workaround?
Thanks!
EDIT:
I played around with this some more. If I start an appliction through the icon the cache seems cleared. Only when I open the page in Mobile Safari, it still uses the wrong file from cache. Pointers still welcome!
EDIT:
I'm starting a bounty on this. I'm using RequireJS and JqueryMobile on the site, so these may also be reasons for the cache not clearing. Still, I don't understand why it clears in app-mode and why it doesn't clear in Mobile Safari.
I have tried the following:
1. Clicking reload page
in the URL bar does not clear the cache. Clicking on the link and then loading the page via go
does seem to clear the cache once in a while
Even though this is a bit hacky, maybe have a go at this workaround (I'm assuming this is for development)
As per the notes in disabling ajax cacheing here How to disable Ajax caching in Safari browser? you could set no-cache headers while developing or in plain HTML like this
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
obviously it won't fix your initial issue of being stuck. but you can break the cycle by adding an arbitrary query parameter ?something=3164 so the URL is effectively unique. then next time it loads hopefully it will hold onto the no-cache params.
If even that then doesnt work you could set up a bookmark which redirected you to a different random=14361 number each time to they are all effectively unique calls - but then we're getting into silly territory!
I'd like to have a proper solution but when I'm developing JS webapps I've found that sometimes everything refreshes properly for a while, then sometimes it doesnt... no real pattern i can tell - apart from the fact i think it seems to do it less when the debugger is enabled (but thats totally unsubstantiated ;-)
When developing for iOS mobile, you can clear the cache easily by plugging the phone to a computer via USB and using the developing tools:
Try stopping safari and restart it and delete all the pages that are there in safari.... see the image how to close the pages
Are you dealing with an HTML5 "offline" application? The use of a manifest file for offline apps is quite new, and has strange quirks for each browser. Modify the manifest file on the server, and the iPhone should fetch the pages again.
EDIT: If you ever had a manifest file (and the HTML attribute pointing to it), if you remove the manifest in the wrong order, your cache can get tangled:
To correctly un-manifest it, try:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With