- Create Account

downloading many times in IE

Forums > IEPNGFix > downloading many times in IE
Author
Message

1) Ted Group: Guests
IP: 24.44.--.--
We are having the issue of the png fix downloading many times per page, thus causing page load time to take forever in IE.

We  think the problem is due to the css rule being applied globally. We are using:

/* { behavior:  url(/iepngfix.htc) } */

Is  there an easy solution as opposed to targeting the rule to specific div's? Which would be a bit of work.

Thanks

2) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 203.109.--.--
Applying to "*" is not the greatest deployment as it'll be rather slow as you have found. Remember you can use full normal CSS selectors, such as:

.png-alpha, #header  img, .logo { behavior.... }

This is of course very dependent on your site, but in an external stylesheet maintenance should be pretty easy.

- Angus.

3) Tarken Group: Members
Posts: 2 Joined: 7 Apr 2008 Location: IP: 130.13.--.--
Thank you, Angus!

I was beating my head over this issue for hours today before I happened upon this message.

Previously I had been using: document.styleSheets[0].addRule( '*', ...
I  changed this to only attaching to the specific items where I need the fix, and it improved page load times by as much as 30 seconds. Whereas I was sitting there previously, watching the "xxx items remaining" count down from about 300, now I don't even see that bit in the status bar anymore.

4) David O'Leary Group: Guests
IP: 70.237.--.--
I just spent days trying to figure out why my site's pages were running much slower in IE7 than any other browser. Then last night, I noticed that for every page load (even simple pages), IE7 was consuming an additional 50megs of memory. I finally tracked the problem down to iepngfix.

We  had been applying it globally, i.e. *. If I apply it just to img, it's still leaking memory, but only 5 megs instead of 50.

Is  anyone else seeing this? Running the demo page I'm not seeing a memory leak so it must be something in my css file.

5) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 203.109.--.--
If you have a lot of elements, adding a behavior to each of them will of course take up a lot of memory.

This script does absolutely nothing in IE7, though, which supports PNGs natively. In fact you could happily put it in an "IE6 only" stylesheet or use a hack like so:

* html #header  { behavior: url(....) };

(where  "* html" means "IE6 only rule"). Generally speaking: apply this script as narrowly as possible and only in IE5.5/6.

- Angus.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.