Making GoDaddy (or any other hosting) initial load faster

Repository

Preface

Ever hosted a website for yourself or your client and noticed that it was extremely slow loading the first time but faster in subsequent loads?

It appears that the servers go into a “sleep” mode after a certain period of time, presumably 5 minutes after experimentation. After this period of time the web pages load faster on any device until it is inactive again.

By going into a sleep mode the hosting provider is able to save money but costs you visitors as they may just bounce off your website.

11 second initial load down to .75 seconds!

Fix

There are multiple ways to fix this.

The first way to fix this is to just upgrade to a higher hosting plan, it’ll cost you more money but you wouldn’t need to worry about this problem anymore.

The second way is to write a small script that keeps your site refreshed at 4 minute cycles. Something like a Raspberry pi / pi zero would work perfectly for this type of task. If you don’t want to go through the trouble of setting up a raspberry pi you can just run a script locally on your desktop.

I should say that your hosting provider may not like this that at all and if done too frequently it has the potential to trigger a DDOS alarm. However 1 call every 5 minutes should be perfectly fine.

Curl-Format

The curl-format.txt provides information on your http transaction timings, this is what will be outputted by the curl command.