CSS3 PIE Forums

VML Cache?
Page 1 of 1

Author:  matthewdl [ Mon Jan 24, 2011 6:47 pm ]
Post subject:  VML Cache?

Is there a way to cache the VML generated by PIE? So that they don't have to be re-drawn from scratch every time? It's probably a pipe dream, but I wondered if anyone had thought about sending generated docs back to a server cache or anything like that.

Author:  jason [ Mon Jan 24, 2011 7:03 pm ]
Post subject:  Re: VML Cache?

It's a good thought, and something I've seriously considered as a performance optimization. Unfortunately, in order for this approach to be at all worthwhile, you have to know all the dimensions of your target elements up-front, because the VML paths (and other properties like background position and clipping, gradient lengths and angles, etc.) depend very much on the width and height of the element at render time. And unfortunately it's very rare where an application will know the element dimensions before the page is rendered, so a server-side cache would rarely be useful.

That said, there are plenty of PIE's internals that are cached at runtime, for instance a given CSS property value string will only be parsed into an object representation once. There are undoubtedly other pieces that can be looked at for potential internal caching, though you have to be really careful and do lots of profiling to make sure maintaining such caches don't take more processing than their original calculations.

I welcome thoughts and advice on these things. :)

Page 1 of 1 All times are UTC - 7 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group