Hacker News new | ask | show | jobs
by marklawrutgers 3790 days ago
Is it okay to minify .css files for production or does it not really matter that much?
1 comments

It's usually recommended. Source maps help you still find right line numbers and test changes, while minification+concatenation lets you write CSS across many files without worrying about HTTP requests.

Do note this practice may be discouraged as HTTP2 gains wider adoption.

> Do note this practice may be discouraged as HTTP2 gains wider adoption.

Concatenation yes, minifying is always a good thing though.

Concatenation still helps under HTTP2 due to better compression (more similar stuff in one file), but the individual files can't be cached/evicted/updated individually, you can't just load the bits you need for the current page, and you can't prioritise certain parts to load first.

What the new standard approach will be I'm not sure.

I'm guessing caching would be prioritized over the improved compression rates, except in very specific circumstances. Though we'll also see improvements there as brotli starts to replace gzip and deflate.