I noticed that when accessing the WordPress admin on this blog, it took a great couple of seconds to load the site up. Then on navigating further everything seems fine.
Whenever I visit other peoples blogs in search for information, I usually don’t have the patience to wait that long for a site to load. So I need to fix this.
Since my blog barely has visitors, I choose to initially not spend much money on hosting (or anything else). So I went for shared hosting, which means I share a server and its resources with a lot of different customers.
These shared hosting plans are cheap and highly competitive, so changes are that these servers are somewhat overbooked to keep somewhat profitable. All of this of course is highly speculative, and I will make no effort of checking any of this 🙂
But what happens if a server is overbooked for its resources? Well, everything that isn’t used for even the slightest amount of time is thrown out off memory to free up some space. Including my website. Then, when there actually is a visitor, my site has to be read from the much slower disk into the memory before it can be served to the visitor.
How to fix?
That turned out to be pretty simple. I have a small computer in my house running day and night to host my personal files and photos. On this machine, I am now running a script that accesses this blog every minute. This keeps the site for the most part fresh in the server’s memory and improves the performance for the visitors greatly.
I could increase performance even more by accessing the site more often, but at this point in time that does not seem fair to the other users of the server with whom I am competing for resources.
Not much complexity needed in the script, that’s also nice for a change.
:go curl https://krakkus.site timeout /t 60 goto go