如何在 IOS safari 上禁用缓存?
有没有办法禁用 ipad/iphone 上的缓存?我想针对非缓存体验运行一些自动化测试。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
有没有办法禁用 ipad/iphone 上的缓存?我想针对非缓存体验运行一些自动化测试。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
我刚刚偶然发现了一种在 iOS 上禁用 Safari 缓存的方法:
iOS
桌面
如果您想要更持久的东西,您可以要么必须走代理路由,要么创建一个
UIWebView
/WKWebView 包装应用程序禁用缓存。
I just stumbled across a way to disable cache in Safari on iOS:
iOS
Desktop
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.我可能是错的,但在 iOS 上,将 Safari 置于隐私浏览模式会禁用缓存吗?
I could be wrong, but on iOS does putting Safari in Private Browsing mode disable cache?
有一种方法可以有效禁用 iphone/ipad/IOS 上的缓存。
在 Windows 桌面上安装 Fiddler,并允许远程计算机连接:
在 IOS 中,在您的计算机下设置代理wifi 连接设置,指向您运行 fiddler 的计算机的 IP 地址和端口 8888(假设您没有更改 fiddler 中的默认设置):
现在,fiddler 应该拦截您的设备发出的所有 Web 请求。
您现在可以从“规则”->“禁用缓存” fiddler 中的性能菜单。
There is a way to effectively disable caching on iphone/ipad/IOS.
Install Fiddler on a windows desktop, and allow remote computers to connect:
In IOS, setup a proxy under your wifi connection settings, pointing to to the IP address of the computer you are running fiddler on, and on port 8888 (assuming you haven't changed it from default in fiddler):
By now, fiddler should be intercepting all web requests your device is making.
You can now disable caching from the Rules -> Performance menu in fiddler.
似乎不可能。在桌面版 safari 上,开发人员工具中有一个禁用缓存的选项,但移动版 safari 上没有该选项。我在其他浏览器(如 Opera)中也没有找到该选项。
如果你想尝试,你可以覆盖桌面版 Firefox 的用户代理字符串,使其成为一个假的 ipad 移动浏览器,然后禁用缓存。但这取决于你想测试什么,它根本不起作用。
希望这有帮助。
Doesn't seems like possible. On desktop safari, there is a option to disable cache in developer tools, however there isn't one on mobile safari. I didn't find the option in other browsers like opera neither.
If you wanna try, you can overwrite a desktop firefox's user agent string and make it a fake ipad mobile browser, and then disable cache. But that will depends on what you want to test and it could not work at all.
Hope this helps.
在最新的 MACOS 中,我无法“完全重新加载”内容。调试确实不是一件令人愉快的事情。
将桌面 Apple Safari 与 iPhone 或 iPad - 应该可以使用ALT+CMD+R - 但不适合我。
最新的技巧是
也许可以帮助某人。
谢谢你的灵感
https://stackoverflow.com/a/24129161/1347601
In the newest MACOS doesn't work anything to "full reload" content to me. Debug isn't really something pleasure.
After connect desktop Apple Safari with iPhone or iPad - it should work ALT+CMD+R - but not for me.
The newest trick is
Maybe help someone.
Thx for inspiration
https://stackoverflow.com/a/24129161/1347601
使用 iOS Simulator 9.0,我发现开发人员 - 禁用缓存菜单项和 Cmd-Shift-R 重新加载都无法完全绕过缓存,无论出于何种原因。唯一有效的方法是按住 Shift 键并按 Safari 开发人员工具中的重新加载按钮:
Using iOS Simulator 9.0 I have been finding that both the Developer - Disable Caches menu item and Cmd-Shift-R reload have both failed to completely bypass the cache for whatever reason. The only thing that worked was to hold shift and press this reload button in the Safari Developer tools:
在 iOS 上,进入“设置”>“高级>网站数据,查找您的网站,向左滑动并单击删除。
On iOS got to Settings > Advanced > Website Data, lookup your website, swipe left and click Delete.