browser cache bypassed in firefox?

落爺英雄遲暮 提交于 2019-12-04 11:32:15

The bug is described here

I can't tell you why Firefox is behaving this way (or better yet, how to override this behavior), but I'd suggest a different approach that might circumvent the problem. Instead of building the html string over and over again and completely removing these img elements from the dom, why not just build it once with an outer container div and show/hide the div? This way, the img's are always part of the dom (and Firefox will most likely not feel the need to remove the images from the cache).

Additionally to Rich's answer, you could try to change some Firefox cache config values and see if they alter the behaviour:

browser.cache.check_doc_frequency
browser.cache.disk.capacity
browser.cache.memory.capacity

Another way to remove the cache hit, to speed up page performance, and to reduce network congestion (generally speaking, only two requests per domain execute at a time) would be to use CSS Sprites.

If all of your images are a similar size, combine some of them and use CSS to control which position of the image is displayed. You'll save the HTTP Requests for each additional image and drastically enhance the page. Many larger web sites (such as Yahoo!) use this technique.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!