Make Web Fast Again! remove, optimize, cache
„The page can’t load any faster!“
Being in the SEO business, you hear this every now and then. And sometimes this is true. But most of the time, it’s not. And now it’s time to tell you that I am sick of hearing this! Get rid of the unimportant stuff you pretend to be your website and focus on content! You should have something to tell or show that is more important than all the other insignificant stuff that blows up your web page making it almost impossible to load and use if not connected through wifi with the newest iPhone X!
Take a front page of a companies website. You will find dozens of people telling you, everything that’s on this page is important – no chance to remove anything without compromising the business. Hard to convince them, that this is not true – you have to optimize it without visibly touching the content. So take the 3 steps that help you simplify the task:
I will go into some details here and I will point out some things. If you want to follow my words easily, open a website that „can’t go any faster!“ and press F12 in your browser. This will open the development tools of your preferred web browser. Here we will focus on the tab named „Network“, so keep an eye on it. Now, let’s go on.
Reduce the amount of content that your CMS produces and is transported to the user. Typically your CMS will do lots of things in the background, until it serves the content. Try to understand, what data it collects and if the result of this data is something that you need rendered on the front page. Keep in mind, that any data collection means database calls and this mostly means slow response. This response may come with images which will show everything even more down in front end.
[press F12 in your browser]
[press F12 in your browser]
BONUS: If you have some sort of Ads on your page, throw them out. You won a bonus round! If you cannot get rid of them, you’re screwed. Nice to meet you, close this page and go on believing that you web page „can’t go any faster!“ – you’re right with that.
Reduce web fonts – at least don’t use them all! If you use FontAwesome to show some few icons, think about including them inline as „base64“. It may be ok with web fonts if you are a typographer or want to sell some slice and nicely licked web design. If not, try to use system fonts. If your content is crap, it will not get better anyway. And if your content is best in class, you could use Comic Sans! (ok, not really).
Reduce images. Let me be clear, use images if they significantly upgrade the content or if they are the content. No vendeta against images. But if you use them just as nice place holders, put them at least under the „fold“ and make them lazy-load. If you load your page in the browser, you should not find more than 20 KB of images in the „Network“ tab.
[press F12 in your browser]
„Optimize“ sounds like „do whatever it takes„, with no one knowing what to do. I understand, so let’s break this down. You should now be in the position where all that is still on your page has to be there – or at least, you are sure you need it.
Compress everything that is plain text. Plain text mostly is HTML, CSS, JS and SVG. (Do not try to compress images or what is binary like fonts. Trust me, you will get no significant size reduction but significant server overload. Just don’t do it. ) When it comes to text, minification often comes into play, where you remove comments, empty space and rewrite functions or CSS classes to shorter names. On the one hand: do it, if it makes you happy. On the other hand: compression will do this for you. So use DEFLATE when delivering everything plain text, dropt his in
Reduce size an colors of images. Ok, I must admit, this is tricky. If you a re lucky, your CMS will crop images to fit their destination size. WordPress does this pretty well. But when it comes to special uses like big header images, you probably have to be more specific to not mess up the image. But in case you can do this for smaller images, reduce colors to 256 or less – maybe there are icons with just a few colors?
BONUS: Activate HTTP2.0 on your server! Some web hoster already do this by default. The magic of HTTP2.0 is hidden behind all the stuff that it does, without you having to think about. Remember the times when multiple „static“ subdomain were used to maximize the maximal connections a browser opens to a certain server? Or how we removed cookies from these static subdomain to minimize the headers? This is all solved by HTML2.0. Go on and use it!
I cannot stress this out enough. Most web pages change their design once in many years. New content is published maybe 5 times a week? Let it be 10 times. In most cases creating the web site „on demand“ is a waste of resources and makes your web server vulnerable for visitor peeks.
Instead you should pre-render the content once in an hour and store it as plain HTML. This is what you deliver then is the pre-rendered, ready-to-serve web site. No hassle with slow databases, lots of data or poor coded, slow CMS. I have to admit, pre-rendering can get tricky if you have
Use a powerful front end server. Install nginx or varnish, let them act as transparent proxy and cache the content. They will serve your content in a ridiculous fast manner and give the web server a rest. But I must admit, you have to know how to install and config these beasts… By the way, if you decide to use nginx do not consider using a .htaccess for your Apache. Including the code snippets I show you here.
BONUS: Learn to use the ETag header: teach your CMS to response with 304 (Not Modified) if the browser asks for resources that are the same as last time. To tell if this is the case, server and browser share the ETag – only if the ETag differs, the content is sent again to the browser. Otherwise the cached content is used.
Yeah, enough dry theory – let’s try all this out! Since I cannot change any web page, I can at least post-optimize a lot of things to give you a feeling about how insanely fast a web site can be if it is not bloated with unnecessary stuff and if everything is cached properly and served through HTTP2.0. I present to you: MakeWebFastAgain.com ! Convince yourself by simply comparing any website with its optimized sibling. You will see how much performance is possible with just three goals: reduce, optimize, cache!