VML cache issue

原创 2006年11月23日 02:04:00

Recently I wrote another png transparency patch for ie6 which use VML instead of AlphaImageLoader.

AlphaImageLoader have many issues, the most famous one is clickable issue. I also found that it can't be used combined with style.zoom property. And, using AlphaImageLoader filter force to hasLayout which maybe not desired. Finally, It's hard to implement background-repeat and background-position feature.

So VML have no such limitation maybe a better solution. But VML also have own issues --- poor MS!

All VML Shape should be set width and height by hand, so to implement no-repeat, repeat-x or repeat-y, I had to dig the width and height of the image. I can't find anyway to fetch such info from VML. So I create dhtml Image object to preload the image, and get its width and height. It seems ok, but one day when I tune the performance of page loading, I found the image has been loaded twice!

After some testing, I found that VML will not use the cache options built in IE at all. In every session (open a new page), it will read the image even the image has been in cache and not expired. In most case, it will result in http status 304. Though 304 is very small in size, but there are still connections which cost lot, for a pages contains many images, and with a slow network, it will degrade the user experience.

On the other hand, AlphaImageLoader ignores cache options too, it always use cache even you press ctrl+F5. The only way to update the image is clearing cache first.

God bless M$! html, filter, vml -- three components, three behaviors.

About cache, AlphaImageLoader is more acceptable than VML. Because the web developers still have some way to refresh the image (by rename the image) for AlphaImageLoader. On the contrary, there is no way to force VML to respect cache except hack the user's browser (no no i have no interest in writing a browser with ie Trident engine, i'd rather to use Gecko).

So, what should I do?


Note: all test under IE 6.0 on Windows XP SP2.



PIO Cache Coherency Issue on Cortex A9

Phenomenon:1)       PIO read sdmmc mbr magic number error, prompt “unknown partition table” in Prima...


GML、SVG和VML都是基于XML的可用来描述矢量图形的标记语言,都是XML词表,它们的语法并不难理解,但它们都有各自不同的用途和特点,下面简单介绍一下。 GML(Geography Marku...


一、什么是VML VML相当于浏览器的画笔,它可以在浏览器中画出任何你想要的图形:小到直线、圆形、圆弧、曲线、矩形、圆角矩形、多边形;大到一张图画、一个动画、甚至于一个游戏。题中既以标明为简明教程,...


什么是vml? VML相当于IE里面的画笔,能实现你所想要的图形,而且结合脚本,可以让图形产生动态的效果。VML是微软1999年9月附带IE5.0发布的,在我认为, VML其实是Word和HTML结合...

VML极道教程(八) shape多边型.shapetype模版.shape与curve曲线


html矢量图 SVG VML 介绍

观看者:想了解html矢量图知识的同学 目标:了解html矢量图知识,svg和vml 兼容方案。 实现方式:代码及相关文字解释。 最近web项目需要一些流程图的支持,于是研究了一下这部分东西,觉得...

VML极道教程(七) polyline多边型



GML、SVG和VML都是基于XML的可用来描述矢量图形的标记语言,都是XML词表,它们的语法并不难理解,但它们都有各自不同的用途和特点,下面简单介绍一下。 GML(Geography Markup...

VML极道教程(九) background背景

VML极道教程(九) background背景

svg 和vml深入了解(路径path&shape)

观看者:有xml,javascript基础的同学 目标:深入了解svg和vml的path属性 实现方式:代码及相关文字解释。希望能一步步写完代码当你看完也就掌握了。 先看两个例子分别...