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.


  • gzxiaohao
  • gzxiaohao
  • 2005年01月05日 09:33
  • 3981

VML 学习笔记

观看者:有xml,javascript基础的同学 目标:熟练掌握vml 实现方式:代码及相关文字解释。希望能一步步写完代码当你看完也就掌握了。 VML的全称是Vector Marku...
  • jumtre
  • jumtre
  • 2014年08月06日 10:15
  • 2463


1、VML:        VML的全称是Vector Markup Language(矢量可标记语言),矢量的图形,意味着图形可以任意放大缩小而不损失图形的质量,这在制作地图上有很大用途,VML只是...
  • jcx5083761
  • jcx5083761
  • 2013年10月24日 16:30
  • 4602

VML极道教程(一) VML介绍

本系列文章导航VML极道教程(一) VML介绍 VML极道教程(二) VML入门VML极道教程(三) 标记实战与line线VML极道教程(四) oval圆rect矩型VML极道教程(五) RoundR...
  • hemingwang0902
  • hemingwang0902
  • 2009年06月27日 17:37
  • 5656

基于VML与HTML5 Canva实现的跨浏览器饼图与折线图

一个简单的JS图表库演示源代码,因为太懒,没毅力,源码给有缘者得之或者有用吧! 1. 支持IE6+以上版本,支持Chrome, 支持FireFox 2. 动画加载机制 3. tooltip支持 4. ...
  • jia20003
  • jia20003
  • 2013年09月16日 21:14
  • 10361


v/:*{behavior:url(#default#vml)}/*声明v为vml变量*/ //模拟数据var RecordSetArray=new Array();//模拟记录条数var iRe...
  • gjd111686
  • gjd111686
  • 2004年07月07日 16:14
  • 2295


  • blade2001
  • blade2001
  • 2010年11月13日 21:47
  • 2224


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


http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> http://www.w3.org/1999/xhtml"> Untit...
  • mtfsoft
  • mtfsoft
  • 2012年04月26日 23:57
  • 956

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

观看者:有xml,javascript基础的同学 目标:深入了解svg和vml的path属性 实现方式:代码及相关文字解释。希望能一步步写完代码当你看完也就掌握了。 先看两个例子分别...
  • a569171010
  • a569171010
  • 2012年05月16日 14:08
  • 4943
您举报文章:VML cache issue