Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable cache on IOS safari?

Is there a way to disable caching on ipad/iphone? I want to run some automated tests for non-cache experience.

like image 331
Dean Avatar asked Feb 09 '12 20:02

Dean


People also ask

How do I disable cache in Safari?

If you haven't already enable the Develop menu on Safari, with Safari open use the menu to go to Safari > Preferences…. One the preferences window select the Advanced tab. At the bottom there is a checkbox to enable the Develop menu. To disable caching in Safari toggle the menu item under Develop > Disable Caches.

Does iPhone Safari have a cache?

In the Safari app , you can erase your browsing history and data to clear the cache on your iPhone. This removes the history of websites you visited and recent searches from your device.

Does iOS clear cache automatically?

If you want to free up storage space on your iPhone, clearing the cache is one way to do it. Some of this is done automatically by iOS, but you can also do it manually. The other reason to clear the iPhone cache is that cached files sometimes slow down the phone or cause things to behave in ways you don't want.


1 Answers

I just stumbled across a way to disable cache in Safari on iOS:

iOS

  1. Open Settings
  2. Navigate to Safari > Advanced
  3. Enable Web Inspector
  4. Switch back to Safari and load a web page

Desktop

  1. Open Safari
  2. Navigate to Safari > Preferences > Advanced tab
  3. Enable the Develop menu
  4. In the Develop menu, select Your iOS Device Name > The Page You Want to Debug
  5. Press Command-Shift-R to reload while disabling cache
  6. Bonus: This is a full Web Inspector on your computer inspecting a page on your iOS device

If you want something more permanent, you'll either have to go the proxy route or make a UIWebView/WKWebView wrapper app that disables caching.

like image 94
Collin Allen Avatar answered Sep 19 '22 09:09

Collin Allen