Groups | Blog | Home
all groups > dotnet xml > june 2004 >

dotnet xml : XSLT: Loading Single Image Multiple Times


Larry Marburger
6/21/2004 12:06:02 PM
I've built and XSLT that is used to generate a simple TreeView-type,
web-based control (ASP.NET / C#). When the tree is fully transformed
(client-side, JavaScript transformation), there are about 5 different
images that are referenced (page.gif, folder.gif, plus.gif, minus.gif,
and clearpixel.gif). What I assumed would happen would be that once it
loads page.gif, every place in the transformed HTML document that
references page.gif would load at the same time. However, what really
happens is the client will request the image page.gif for each and every
instance of page.gif on the resulting HTML document.

As it stands now, the tree has 600+ nodes. This results in 5 separate
images on the page, but ~2,400 image requests. This is, obviously,
highly unacceptable.

Any ideas about how to minimize the amount of image requests sent to the
server?
Oleg Tkachenko [MVP]
6/22/2004 1:31:21 PM
[quoted text, click to view]

Well, I don't see what the problem has to do with XML or XSLT. You are
generating HTML for client browser, right? So whenever there is a
problem in such scenario, first check HTML and make it work properly.
Then make sure XSLT generates exactly HTML document you need.
For thus particular problem I'd play with CACHE-CONTROL META tag in HTML
or better ask in HTML or IE related newsgroup.

--
Oleg Tkachenko [XML MVP]
AddThis Social Bookmark Button