Get a better pagespeed score

I use https://developers.google.com/speed/pagespeed/. If it gives a good score it might give SEO advantages as well.

Other than that I do a few simple things.

Only 1 js file and 1 css file

Some people like to have 1 base css and then have one css for each template. It means less information in bytes needs to be loaded. It also means 2 http requests instead of 1. In most cases the extra http request takes more time than the extra bytes of a css file that contains everything. This larger css file is also in general cached by the browser which mean that the next page css will load faster.

It could be a debate about this, but that’s how I work with it and Google Pagespeed agree that it’s a good idea.

Images

A really simple solution to optimize load time on an image heavy page is to remove the images or add a pagination for them. I often saved the images as png because I like quality. I’ve stopped doing that because compressed jpgs are so much smaller. So, use jpg. If you have a logo, use svg if possible. It scales and is a small format.

Compress html

There are 3 Kirby plugins for compressing html:

I think all of them works more or less fine.

Caching

Kirby has a cache. For heavy function calls it’s also possible to cache a part of the page.

Don’t use jquery or other frameworks

http://youmightnotneedjquery.com/

It’s also debatable, but I’ve started writing my sites with javascript without jquery. More and more js plugins are no longer dependent on jquery. It will save about 100 kB of javascript to skip jQuery.

I also try avoid to css and js frameworks because they probably contains 5% of what you need and 95% of what you don’t.

Always keep speed in your mind

If you have speed in your mind from the first line of code it will probably be a fast site. Then you will avoid all the things that has a price in terms of speed. Ask yourself, is this needed by users or is it just for fancyness?

There are so many things you can do for performance of a site but here are a few ways I like to do it. A good hosting providor is also important.

7 Likes