I'm doing some testing on a mobile site in development and there are many updates and changes happening to this site. In order to test afresh and clear any JavaScript or what-not that is held in the cache on my iPhone I need to clear the site from the history.

However, i'm not too keen on wiping all my browser history as I don't want to have re-sign into every site I'm currently logged into or have cookies for. This testing could last several months and the thought of having to clear my history and sign into all my various accounts every time is not that appealing.

Is there a way to specifically clear out the history of just one domain from my history without wiping all my cache out?

I could (and do) have other browsers on my iPhone (chrome, opera - if that even counts as a browser) but as Safari is the browser the target audience will mostly use I need to keep with this one predominantly.

  • 2
    I'd suggest to handle your cache headers in your development environment properly and disable caching there. – Gerry Nov 29 '12 at 11:35
  • I'm with @gerry in sidestepping hacking browser caches which have no API or way to do across all (or even any) iOS versions. Getting a dedicated test device that you wipe often is my solution when I don't want to change the sites code to disable browser side caching. – bmike Nov 29 '12 at 12:56
  • It's not really a hack I'm after, but whether or not iOS safari even has the option to 'forget this site' or some such method. – JonW Nov 29 '12 at 14:11
  • It hasn't really, perhaps if you jailbreak. – Gerry Nov 29 '12 at 14:39
up vote 22 down vote accepted

I don't know if this is exactly what you want, but if you open Settings, then click on Safari, then scroll down and click on Advanced, then click on Website Data you will get a list of websites that have stored data. You can click Edit then remove the data from just the sites that you want to remove stored data from.

  • 5
    Well what do you know, that does exist on iPhone! Damn, that's a long list of websites in there. All unsorted (except by size of data held - that's rather annoying) – JonW Dec 3 '12 at 14:20
  • Yeah. Usually in cases like that you can pull down to reveal a search bar, but not here. Would be nice. – jinglesthula Aug 16 '16 at 20:48
  • Thanks for this Safari tip. I really wish I knew a way to do this for iOS Chrome. – Ryan Jan 25 '17 at 3:41
  • 2
    Holy smokes! This works for iOS Chrome (and maybe every browser): superuser.com/a/427479/74576 – Ryan Jan 25 '17 at 3:44

You could also use this in the browswer, ?nocache=1 behing the URL. example www.constructivworks.com/?nocache=1

This should clear the cache specifically on the site you have open in that specific tab.

Hope this helps!

  • Is this a browser feature or server side? I'd expect it does little more than request a new page form the server, leaving everything else cached. – Deanna May 28 '16 at 16:55

To clear cookies for a specific site on Chrome for iOS

  1. Save any site as a Bookmark via 3-dot menu at top right
  2. Rename Bookmark to something like “Clear Site Cookies”
  3. Copy/paste the below code below as the URL

Now just visit any site, pull up your bookmarks and click on the bookmark we just made. That will clear the cookies just for that one site, even on Chrome iOS.

javascript:void((function(){var%20a,b,c,e,f;f=0;a=document.cookie.split(";%20");for(e=0;e<a.length&&a[e];e++){f++;for(b="."+location.host;b;b=b.replace(/^(?:%5C.|[^%5C.]+)/,"")){for(c=location.pathname;c;c=c.replace(/.$/,"")){document.cookie=(a[e]+";%20domain="+b+";%20path="+c+";%20expires="+new%20Date((new%20Date()).getTime()-1e11).toGMTString());}}}alert("Expired%20"+f+"%20cookies");})())

References

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.