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.


最近因gis部分展示需要兼容IE8,特针对leaflet代码进行了兼容IE8的开发工作,绘制展示方面使用了VML 网上大多数使用JavaScript动态添加命名空间的方式为: document.nam...
  • GISsunchangfu
  • GISsunchangfu
  • 2017-08-24 15:48:42
  • 555


  • blade2001
  • blade2001
  • 2010-11-13 21:47:00
  • 2309


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


hello vml!!!v/:*{behavior:url(#default#VML);}第一个VML实例(2个OVAL圆形,1个roundrect圆矩形):  包含内容 请你务必仔细分析上边的代码,...
  • lixiaokui11
  • lixiaokui11
  • 2009-09-07 11:23:00
  • 1570


效果图如下: String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.ge...
  • lishirong
  • lishirong
  • 2014-12-02 09:51:13
  • 479


1. VML标记特有的通用属性(非HTML、CSS所有)  属性名 默认值 值类型/范围 ...
  • yzj_000
  • yzj_000
  • 2007-08-15 15:36:00
  • 1175


解决了我的疑惑,很有帮助 转自 http://hi.baidu.com/jz1108/blog/item/8d16d550649ae3561138c228.html    最近发现使用VML绘制的图形...
  • black_ben
  • black_ben
  • 2010-04-20 11:50:00
  • 3408


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

VMware Harbor:基于 Docker Distribution 的企业级 Registry 服务

原文来源:Rancher Labs 前言 对于 Harbor 这样一个优秀的 Docker Registry 管理开源项目,以下内容基本上来自前人已有的研究,我只是将其在实践中进行了测试,并整...
  • RancherLabs
  • RancherLabs
  • 2016-12-06 00:17:05
  • 630

<canvas> 标记和 SVG 以及 VML 之间的差异

标记和 SVG 以及 VML 之间的一个重要的不同是, 有一个基于 JavaScript 的绘图 API,而 SVG 和 VML 使用一个 XML 文档来描述绘图。 这两种方式在功能上是等同的,任何...
  • caoxj0507
  • caoxj0507
  • 2012-02-26 10:58:48
  • 1390
您举报文章:VML cache issue