I'm completely with you on the 3rd party stuff too. If I run ublock on the relatively JS heavy React site I work on, load times creep in at sub-second, I reckon I can get that down to half a second by hammering the code and applying some smoke & mirrors, but there are obviously diminishing returns on client side optimisation.
Disable ublock and that loadtime triples - likely due in no small part to the three (3!!!) different versions of jQuery the adverts & misc 3rd party scripts are currently loading.
I can't help but wonder if the secret to fixing the internet for the less tech savvy general public isn't messing about with stuff like AWP, offline first, whatever, but to force code going through DFP and GTM to respect the browser and the host site a little more.
There is still worth mentioning the issue of executing code once it's decompressed - so properly scoping a var is always better value for money than global.ancestor.foo.bar etc.
That said, my point still remains the same time invested in learning+using+tuning uncss would probably be better spent on any of my points or some others suggested here. AFTER that, sure! I got the whole page for the library I linked down to 10kb in TOTAL including images [in svg] for a competition. It has gained a bit since then though, mainly with analytics.
In terms of developer productivity, keeping stylesheets uncluttered and easier to maintain is a good idea anyway.
Quoting the article:
"CSS with this much repetition is also expensive: It’s expensive to create, and it’s particularly expensive to maintain (not even variables will save those who, on average, repeat each declaration nine times, like the Engadget and TED teams)."
In fact, I'd go further and say in a lot of cases it's not even something you're hosting.
It's what third party resources you're relying on. Got ads? That will be the biggest bottleneck here, since ad networks load hundreds of KBs worth of scripts and images that most people block or ignore anyway.
Same with third party social networks and media sites. That YouTube video or embedded tweet is probably using a lot more of your user's bandwidth than anything else.
Not sure what the solution would be there, especially if you're reliant on the ad money or need to use videos or third party media to illustrate your article.
Might not always be true but in tests I've done on my company's sites the http2 load is always faster with no CDN, even from far away locations.
The golden age of CDN's is over. Their primary advantage was being able to open up many parallel connections using multiple subdomains and the ability to cache across domains.
With http2 multiple connections have become a bad thing and https is mandatory so CDN caching is irrelevant.
On http2 and a tiny AWS instance I can get sub 200ms page loads from anywhere in the US if I host in the midwest. The gain from avoiding multiple HTTP connections, TCP slow starts, and TLS negotiations negates all the speed advantages of using a CDN. Cloudflare might be worthwhile if you get massive traffic but a small Nginx instance can handle hundreds of megabytes per second of traffic.
That being said, for less mission-critical projects, they do have their place.
CDNs involve a big set of tradeoff choices you have to make, they don't make sense for every circumstance. I don't think I'd ever throw in "Use CDNs as much as possible" into an optimization advice list.
CDNs are one of those cases where the cloud vastly outperforms whatever kind of server you have.
- Optimizing your images.
- Concatenating+minimizing+gzip the JS and CSS.
- Optimizing Javascript.
Likely in order; mileage might vary. If those 3 are already in place, then it might make some difference to optimize the CSS.
First meassure what you actually want to improve (it is not page size per se, it is loading time). Then make sure that you optimize it and not something else.
[1] https://picnicss.com/