为什么我的Mobile Safari缓存无法清除? [英] Why my Mobile Safari cache won't clear?

查看:217
本文介绍了为什么我的Mobile Safari缓存无法清除?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的iPhone4(iOS4)iPad1(iOS3.3)和桌面上调试网站。

I'm trying to debug a site on my iPhone4 (iOS4) iPad1 (iOS3.3) and desktop.

我的问题是我无法清除iPhone缓存

My problem is I cannot clear the iPhone cache at all.

如果我将警报/控制台添加到我正在调试的js文件中,它们会显示在iPad和桌面上,但iPhone只是从缓存中重新加载。

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.

如果我通过设置清除缓存> safari>删除浏览器历史记录,缓存,Cookie 并在Safari中删除全部书签和删除服务器上的文件,iPad和桌面中断(丢失的文件),但iPhone仍然加载页面,好像什么都没发生。

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?

谢谢!

编辑

我玩了一些这个。如果我通过图标启动应用程序,缓存似乎已清除。只有当我在Mobile Safari中打开页面时,它仍然使用缓存中的错误文件。指针仍然欢迎!

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!

编辑

我正在为此开始赏金。我在网站上使用RequireJS和JqueryMobile,因此这些也可能是缓存未清除的原因。不过,我不明白为什么它会在应用程序模式下清除,为什么它在Mobile Safari中无法清除。

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.

我尝试过以下操作:

1.在URL栏中单击重新加载页面不会清除缓存。点击链接,然后通过 go 加载页面似乎偶尔会清除缓存

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

推荐答案

即使这有点hacky,也许可以解决这个问题(我假设这是用于开发)

Even though this is a bit hacky, maybe have a go at this workaround (I'm assuming this is for development)

As根据禁用ajax缓存的说明如何在Safari浏览器中禁用Ajax缓存?您可以在开发时设置无缓存标头,或者在这样的纯HTML中设置

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">

显然它不会解决您最初被卡住的问题。但您可以通过添加任意查询参数来解决周期?某事= 3164因此URL实际上是唯一的。然后下次加载它有希望它将保持无缓存参数。

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.

如果即使那样不起作用你可以设置一个书签,每次将你重定向到一个不同的random = 14361号码,它们都是有效的独特呼叫 - 但是接着我们进入愚蠢的领域!

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!

我想要一个合适的解决方案但是当我开发JS webapps时,我发现有时候所有东西都能正常刷新然而,有时候它并没有...我没有真正的模式 - 除了我认为在启用调试器时似乎做得更少的事实(但这完全没有事先证实; - )

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 ;-)

这篇关于为什么我的Mobile Safari缓存无法清除?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆