Why your blog is so slow

Skip to short version

Did you know, you can measure your page load time? Well I tried it with my blog (pius-ladenburger.de) and with the homepage of my survey tool getOpenion (getopenion.com). The results were:

webpagetest.org (2 tests because of caching)
getOpenion.com: 1. 3.137s and 2. 1.529s
pius-ladenburger.de: 1. 3.573s and 2. 2.834s

tools.pingdom.com (best values)
getOpenion.com: 967ms
pius-ladenburger.de: 2s

Now you might have already noticed that the homepage of getOpenion is faster and in the second test even much faster. Now this might be even more interesting if I told you, that the page size of getopenion.com was 1.2 MB (images aren’t optimized) and pius-ladenburger.de only 888.6 kB.

So why does the bigger page load faster than the smaller one? Let me tell you.

One reason could be because both websites run on a different shared server, where one could be busy serving other pages while the other one is idle. Same counts for the router, datacenter, etc. …
But repeated tests have shown that in this case it’s not the reason.

I rather believe the reason is the used CMS (Content management system – the code generating the website). My blog runs on WordPress and the getopenion.com on a custom one-paged php file, which is not even highly optimized by the way. WordPress is a huge CMS, it has lot’s of files – and a lot of code is executed everytime a page is opened. Each line – or rather each command – costs time. So WordPress might be powerful and easy to use but on the contrary side it can get very slow – and it get’s slower with every plugin you install.

So you might wonder, how can I solve this issue? Well first off, if you would like to stick to WordPress because it’s easy to use (very practical for your clients too), I would recommend you to enable PHP caching in your server or download a WordPress caching plugin. If you’re more in to all this stuff you can try to go for a flat-file CMS like Pico CMS (I have been using it* and even created One CMS based on it), Kirby, Grav or do a web search. If you are only doing a basic website – mainly static HTML, I would recommend you: do static HTML and write a small PHP script, which generates the dynamic things like the menu for you and of course get’s the HTML from the files you wrote, and have a htaccess file (or some option in your server) point all requests to that php file. And your load times will shrink so low, you would see them!

Of course there are more reasons and therefor methods to improve the page load times. Theres your hoster: It depends how much traffic he has, how fast he is connected to the internet, how fast the connection to your server is and what kind of server you have (shared, virtual or dedicated).
Then you can speed them up by using CDNs (Content Delivery Networks). They work by serving your page directly from a place near to the visitor (for example my website is hosted in Europe why an American visitor would have much longer loading times then a european one but with a CDN, I could have a cached version from an US Datacenter serve it or even have a own server generate the page there).

I have now optimized getopenion.com to 911 kB and 771 ms load time after the test by reducing the size of the images by around the factor 2. The fonts are another factor but I prefer to host them myself instead of letting Google track my visitors.

I hope this post helped you – if not just write a comment and I will do my best to answer your question or improve my next articles.

* I made a website base on Pico for a client: size 2.9 MB, load time: 661 ms

 

Short version Learn more about short versions here

WordPress websites take much longer to load then flat-file based CMSs because it contains lot’s of code, which you might not always need but which is included to make it so powerful and still easy to use as it is: slower pages for flexibilty. You can speed up WordPress by using PHP caches or switching to an optimized CMS.

There are more methods to speed up pages – independent of the CMS: CDNs or good hosters.

 
Source for the icon.

Comments are closed.