CSS-JS-Booster icon indicating copy to clipboard operation
CSS-JS-Booster copied to clipboard

Duplicate data-uris bloat the CSS

Open rodneyrehm opened this issue 15 years ago • 3 comments

If the CSS contains multiple references to the same image, CSS-JS-Booster currently embeds the image for each occurance. This can easily lead to a pretty large CSS file (or many chunks of it).

MHTML does not fall for this. but with data-uris I don't see a viable solution to reducing the overhead. The only way out is to skip images with multiple references. If the WebDev still wishes to make use of data-uris, he must modify his CSS accordingly.

rodneyrehm avatar Oct 25 '10 20:10 rodneyrehm

When I have the time, I will do some experiments and tests trying to shift all images to a second lazy-loaded file. But its complicated and also bears the risk to break the CSS-cascade if done wrong. So I can't promise anything and I also don't know when this will be ready (or dismissed).

Schepp avatar Oct 25 '10 21:10 Schepp

You should have a "background definition" css file when developing.

It's easier to maintain especially when using css sprites.

vvo avatar Jan 04 '11 14:01 vvo

True. Did you know that you can already do the lazyloading-thing in Booster? https://github.com/Schepp/CSS-JS-Booster/wiki/Advanced-Usage

$booster->css_lazyload = TRUE;

Schepp avatar Feb 22 '11 10:02 Schepp