CSS 多次请求图像
知道什么会使样式表多次加载图像吗?图像的 URL 相同,没什么特别的。
编辑:仅发生在 iPhone“模式”和默认“模式”下的 Safari(5.0.3)中 - 我无法在 FF 或 IE 中重现该问题。
Apache_access_log 表示该图像确实被多次访问。
当添加将图像一一调用回来的样式时,它们似乎不遵循任何关于何时开始加倍的模式。
我还尝试使图像明显变小,以查看是否是缓存问题。没有改变任何东西。
Any idea what would make a stylesheet(s) load images multiple times? The images are the same URL, nothing fancy going on.
EDIT: Only happens in safari (5.0.3) in both iPhone "mode" and default "mode" - i cannot reproduce the problem in FF or IE.
Apache_access_log says that the image is indeed being accessed multiple times.
When adding styles that call the image back in one-by-one, they don't seem to follow any pattern as to when they will start to double up.
I also tried making the image significantly smaller to see if it was a cache issue. Didn't change anything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定 Safari 是怎么回事,但显然:
如果引用相同 sprite-sheet 的 CSS 规则没有分组在一起,它将多次请求图像。 (尽管不是呼叫出现的完整次数)。
这将请求一次图像。
这将请求图像两次。
不知道为什么会发生这种情况。
Not sure what the deal is with Safari, but apparently:
If the CSS rules that reference the same sprite-sheet are not grouped together, it will request the image more than once. (Although not the full number of times the call appears).
This would request the image one time.
This would request the image twice.
No idea as to why this happens.