/ raspberry pi

How to Speed Up Your Ghost Blog on Raspberry Pi

Now you are a blogger and have installed Ghost on Raspberry Pi, it is essential that your Ghost blog loads quickly. Having a slow website can have a number of negative effects:

  1. A slow Ghost blog means your visitors will be waiting to see your website rather than spending time reading what you have put on it. The longer the wait, the greater the chance of that visitor giving up and leaving.
  2. Search engines, such as Google, take site speed into consideration when ranking a blog in search engine rankings. The slower your site, the lower in the search ranking your site will appear.

Site speed and Google

"The average time it takes to fully load a mobile landing page is 22 seconds." - Google Research, 2017

Take some time to think about that. Twenty-two seconds is a long time when visiting a website for the first time. The next stat from the same Google Research is even more thought provoking:

Did you know that if a website takes between 1 and 10 seconds to load, the bounce rate probability (i.e. the rate at which a visitor will give up and leave) increases by 123% whereas a website that loads between 1 and 3 seconds is increased by around 32% in comparison?

This means that around 53% of mobile site visitors leave a page if it takes more than 3 seconds to load.

How to Speed up Your Ghost Blog

Thankfully, Ghost is already designed with speed in mind. If you have been following this blog to install Ghost on Raspberry Pi, you will have already optimised your blog with NGINX and CloudFlare, so you're already doing well - hopefully!

Test your site speed

To speed up your Raspberry Pi Ghost blog, you first need to know how your site is performing. There are many online tools available to test this, including Google's own PageSpeed Insights, but I like GTmetrix instead as it gives you a more detailed overview of what is going on, and what you can do about it.

To test your site, simply enter your URL, click "Analyze" and wait for the results:

GhostPi's GTmetrix Score - 98%!

Results and recommendations

GTmetrix also provides a great deal of information on how to speed up your website, but don't get obsessed with trying to get 100%! There are some recommendations that cannot be implemented, mainly due to how Ghost has been developed, but these implications are minor and should not cause you any concern.


Tips

1. Optimise your images

One really simple trick to boost your Ghost blog speed is to optimise any images you use. You do not need to be a Photoshop ninja to do this, as there are some free online tools that can do this for you - ShortPixel being one of the best I have come across.

ShortPixel is free to use for 100 images (you can pay to optimise more images, but 100 should be more than enough) and you simply drag and drop your images into their online image compressor.

ShortPixel's free Image Compressor

Doing this can reduce image files (PNG, JPEG, GIF) by a significant amount and will have a decent impact on how fast your blog will load as a result.

2. Use correctly sized images

Okay, this could be part of number 1 above but you do need to do some image manipulation here. Using a large (as in dimensions not file size) image for something that is small on-screen is a waste of precious bandwidth, which will result in a few extra seconds spent loading your blog.

When I tested Ghost Pi in GTmetrix, one recommendation was to use a smaller image file for my main logo as the one I had uploaded was being resized by CSS from something like 3000 x 3000 pixels to 150 x 150 pixels, but the file size of the image was still the same. I used Photoshop (GIMP is a free alternative) to shrink my logo to 150 x 150 pixels, dropped it into ShortPixel's Image Compressor then re-uploaded the logo to Ghost and this shaved precious seconds off my blog's page load speed.

3. Don't go overboard with images

A common theme is appearing here... Using too many images on your Raspberry Pi hosted Ghost blog will only slow your blog down. Use images on your blog by all means, but don't go overboard and use them for the sake of as this could be the difference between a visitor staying and reading your blog and them giving up and heading back to Facebook or Twitter...

4. Keep it simple

You may notice that my Ghost blog uses different fonts. These fonts are served by Google Fonts and I had to include some simple code (via the Code Injection feature in Ghost) to get them to work properly. This itself adds up when loading a blog as the page will need to load the external fonts to be able to display the page nicely.

Again, this comes down to your preference here. I like having a few different fonts on my Ghost blog because I want it to look different to the rest, and the trade-off in site speed was pretty insignificant for me. However, if I chose to add different fonts all over the place, then this could be a different story.

5. Learn

Ok, this isn't really a tip but some advice. When I started writing this blog, I had little knowledge of how to speed up my blog, and some of the recommendations provided by GTmetrix was confusing. However, my best friend in all of this was Google and a few searches here and there really helped. Hopefully, this blog post will really help you speed up your Ghost blog, especially if you have installed it on your own Raspberry Pi.

Wesley Archer

Wesley Archer

Digital Account Manager by day, and maker in his spare time. Also, a regular contributor to The MagPi Magazine for the Raspberry Pi Foundation.

Read More