How to disable cache on IOS safari?

后端 未结 6 1282
广开言路
广开言路 2021-01-31 09:19

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

6条回答
  •  感动是毒
    2021-01-31 09:35

    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.

提交回复
热议问题