4 ms·
With the majority of websites, the content is changing the majority of the time which means the HTML has to be compressed after each change & sure they’re are s
by itsprofitbaron 14y ago
With the majority of websites, the content is changing the majority of the time which means the HTML has to be compressed after each change & sure they’re are scripts to do this but in comparison, CSS/JS files are rarely changed – they’re generally changed when a new feature/design is implemented.
Another reason is because, websites are becoming more dynamic & it’s not very cacheable – CSS/JS are extremely cacheable. Since on every request you have the extra task of running minimization on the complete HTML of a webpage (especially if your website is dynamic and you’re using a script to do this) and this is time you could have used to transfer data.
Moreover, there are other low hanging fruit that most websites need to tackle first – minimizing HTTP request, removing unnecessary images, minifying images, minifying & combining CSS/JS.
- TazeTSchnitzel 14y ago>extra task of running minimization on the complete HTML of a webpage Of course that would be slow, but if you have compiled templates on a dynamic site, could you not strip out whitespace at compile-time?
- itsprofitbaron 14y agoMinifying dynamically generated files on the fly is harder than static ones (Its obviously possible but you have to take it into consideration) & there are some cases where it actually might decrease performance as, every page request requires minifying. Personally, I think the benefits of minifying your HTML won't pay off until you're receiving a significant amount of traffic anyway. Which is why, for the large majority of sites they'll see better value through minifying/combining their CSS/JS and tackling the other low hanging fruit first.
- mistercow 14y agoI think you didn't understand the parent post. TazeTSchnitzel is saying that when the template is initially compiled, it can be minified. Then you'd get that minification for free forever after.
- itsprofitbaron 14y agoI understood the question which is why, I said there are still performance issues if you try to do this & its only beneficial to websites that receive a large volume of traffic as they are the ones who will see the benefits of doing this; there are other low hanging fruit that can improve performance before even looking minifying HTML.