β‘ As a Web Developer, you should always minify your CSS/JS!
Minifying your code is crucial to ensure your website is fast and good performing for modern SEO!
π Learn how to minify your CSS/JS in seconds!
1οΈβ£ Why you should minify CSS/JS
Minifying your CSS/JS reduces its size, no unnecessary white spaces, and no comments are loaded.
Those changes can drastically decrease the payload size of your request.
For JS, it even can strip down function and variable names!
2οΈβ£ How much does minify save you?
In our example below, we have a simple portfolio page.
The default CSS was not minified and had a size of 2.1 kb.
The minified outcome is 1.1kb, which is nearly 50% savings.
Imagine those savings on greater websites! π€―
3οΈβ£ How to view minified code in your Browser?
The Chrome DEV console offers you to view directly minified code un-minified.
This works easy for CSS and can be hard for JS as it also transforms your function and variable names!
4οΈβ£ How to minify your CSS/JS online?
There are various websites to minify your CSS and JS quickly.
Some of the most known are:
There are plenty more. These are just some examples.
π
You may do not want to minimize your CSS always by hand.
It is recommended to set up a CI that can handle automatically minifying your CSS and JS.
It does not matter which CI tool you are using in the end.
Having just the savings, in general, can be a huge boost!
β‘ Every Web Developer should know how to create next-gen image formats
Serving your images in next-gen formats is crucial to ensure your performance is fantastic and loads fast for any of your users.
π Learn how to create images in the next-gen format in seconds
1οΈβ£ What are next-gen formats?
Next-gen formats are image formats such as
- WebP
- AVIF
- JPEG 2000
- JPEG XR
We will focus on WebP as this has the best support across all browsers and is most used!
2οΈβ£ What is WebP?
WebP is a next-gen image format published by google in 2010. It creates lossless images that are 26% smaller than PNG's and lossy images 25-34% smaller.
In reality, I have seen over 40% smaller sizes already.
β‘ Every Web Developer should know what Critical CSS is and how to use it
Using critical CSS and defer non-critical CSS can boost your website's performance which is becoming more important!
π Learn how to extract critical CSS and defer non-critical CSS
βΆοΈ What exactly is critical CSS?
Critical CSS is any CSS that is relevant for elements being displayed above the fold. Above the fold are all elements that are rendered within a user's viewport when visiting your website. Anything else is non-critical!
βΆοΈ How can you extract your critical CSS?
One of the easiest methods to get quickly started is by using an online tool.
There are plenty out there.
For our example, we will use sitelocity.com/critical-path-β¦.
Just enter your domain, and generate your critical CSS in a second.