Categories
Web Development

The Fastest Website in the World!

Since a lot of people out there land on my personal website looking for help and assistance making really really fast websites, which rank well in Google, often I’m asked questions about how to make fast sites.

So strap in and get ready to roll with a description of how I made this one of the Fastest websites in the World! Yeehah!

If you’d like to make the fastest website in the World, how would you go about doing this?

Well, the short answer is, every single element needs to be 100% optimal.

I’ve been accused by some developers of practicing “micro-optimizations” which I take to be a compliment. Of course I practice this. Like a Forumla 1 engineer, optimal is a case of piling micro-optimization after micro-optimization on top of each other in order to achieve a stack of optimized machinery which, when all is added together, is as fast as it is possible to go.

So where to start?

Let’s begin at the beginning. I’m going to talk about hosting a PHP web application, like WordPress. You can use JS frameworks, or write plain HTML which is very fast. But the majority of businesses use a CMS, and the majority of people who use a CMS use WordPress, because it is stable and easy for less technical members to familiarise with. So let’s speed up the typical WordPress stack.

Fastest Website?

This website – robinjescott.com – loaded during testing in 0.2-0.313 seconds on home. This post’s URL loads in 0.35-0.47 seconds (tested via Pingdom) in London, UK. Load times globally will differ a little, but all elements are fully loaded in under 1 second in all test locations.

Google PageSpeed score is 92. Yslow score is 100.

This website runs the latest version of WordPress, and a child theme of the stock Twenty Nineteen theme. In short, you can be this fast.

WordPress is Fast, Secure & Ranks

  • Never been hacked – running WordPress.
  • Under 0.4 seconds fully loaded – running WordPress.
  • Ranked on the first page of Google results as “the fastest website in the World” – running WordPress.

Your Domain Nameservers and DNS

The nameservers you use to host your domain records, and the DNS records themselves matter in terms of speed.

There are two issues here: lag and server response time. There are other considerations here, too, such as TTL, which will tell all the various network caches around the world how long your domain DNS records are authoritative. Unless you are making regular changes to your DNS, and unless you have a particularly fast and globally available namesevers, you should set this to be pretty long, like 12 or 24 hours (or more).

My recommendation for your nameservers is to look at globally available service like AWS Route 53. These cost something like $0.50 a month to host all your domain’s DNS, but are blazing fast globally.

Set your domain @ records TTL to be 48 hours or longer if you don’t expect to change these – allow network level caching to do it’s thing.

Your Hosting Machine & Stack

There are a lot of elements to the hosting machine, but general rules apply, as well as some specifics.

For WordPress sites, I recommend either:

If your site is a PHP application running Magento or similar, I recommend to try your site on Cloudways – use Vultr.

Note if your site is WordPress with WooCommerce, have a look at the Best WooCommerce hosts here.

Don’t use Shared Hosting

If you are looking for optimal, do not use shared hosting. This is a recipe for disaster, because (and the clue is in the name) your site will share resources with others, leading to bottlenecks.

Use a VPS, Cloud Host or Dedicated Server

You want your resources dedicated to your instance. Which is best depends a little on the size, scaling requirement, and location of your hosting machine – all of which are debatable – and whether or not you need clustering or redundancy to be factored in.

Buy as much hardware as you can afford… but not more than you need

I often see people throwing hardware at sites in an effort to go faster. It doesn’t work like this. You need RAM and CPU to be sufficient, and there is a performance advantage to certain choices (like choosing SSD drives, or having more CPU cores for certain operations) but in a lot of cases, the hardware needs only to be sufficient. Big enough, and capable of holding the fastest software is sufficient here.

The Web Server – Nginx

Apache is slow. There, I’ve said it. It is also a very powerful and stable web server. In my opinion, Nginx should be taking the initial requests, however, and either serving directly, or caching apache’s slight slowness out of the mix.

Use PHP 7.3

The most recent version of PHP is faster than the last. It’s also more secure. But, you will likely need to refactor your code to be error free, particularly if you have code which is a few years old. Consider dropping support for older versions of PHP in your code, if you will never use them.

MySQL – Consider MariaDB 10 or MySQL 8

MySQL 8.0 is looking likely to be a real performance boost. Until this is regularly available, MariaDB 10 is a really fast alternative. Please note that conversion from MySQL 5.7+ to MariaDB is not straightforward, so you need to make a decision at this point (there are other ways to import data, but it is worth remembering to make your decision at MySQL 5.6 with this in mind).

There are other (somewhat political) reasons to make the MySQL vs MariaDB choice. I’ll not get into politics here, except if it impacts speed. MySQL 8.0 shows a moderate performance boost over all equivalents in my most recent benchmarking.

Look at your Code

Maybe I should have led with this. Slow performance is almost always a result of some code (or lots of code) in the system which does things the long way around. You need all the elements of your code to do things fast. Think fast first when you are choosing everything software related, including your theme and plugins if you use WordPress.

Got Questions – Leave them below

There’s obviously lots more I can add in here. If you’re interested to know more, see my long guide to optimizing WooCommerce for some granular stuff you could get into, or ask a question below.

I aim to build this section out more over time to become a working guide to the fastest possible stack for your PHP web applications.

Please ask and complain if you agree, disagree or want to know more.

23 replies on “The Fastest Website in the World!”

Please note, this piece is deliberately vague. I’m focussing on choices you will need to make, not technical solutions. There’s plenty of tutorials out there – I’ve posted a lot of them myself. This is a slightly wider view about what fast is, and how to get there.

An interesting discussion is worth comment. I think that you should publish more about this subject, it may
not be a taboo subject but generally folks don’t discuss such topics.
To the next! Kind regards!!

I love that you’ve written a wide approached article to building a fast site.

I am obsessed with site speed and have found litespeed servers to be insanely fast…

For example, i have litespeed server with litespeed cache partnered with cloudflare static caching cdn. In the UK on Chrome, Safari etc and on pingdom my site loads in just over half a second on the homepage….

Not that impressive, but…

My huge 11mb webpage on google algorithm updates loads in 0.6 seconds with the above stack;

No VPS, just a decent cloud hosting in the UK.

In the coming years and the move away from pc, page site speed is going to become ever more important for both UX and SEO.

Mobile is substantially slower and thus, you need insanely fast desktop load times just to buffer then inevitable drop when a user visits a site on mobile.

But yeah, i might be a little insane like you for page speed 🙂

All the best,
Adam

Yeah Litespeed is usually better than Apache for speed. It generally performs a little slower than straight Nginx (and is also proprietary rather than open source too).

Most people seem to compare Nginx + Apache with Litespeed, which is an unfavourable comparison.

Compare it with a LEMP stack, with no Apache, and you’ll find Nginx is a clear winner.

Hi Asif,

Upgrading to PHP 7, wouldn’t “damage” your site, but some of your plugin or theme files might not be compatible, and this would cause an error, and in some cases, lead to a white screen (i.e. your site not working). You would want to check and resolve these errors BEFORE you upgraded.

There’s a plugin called “PHP Compatibility Checker” which is in the WP repo (it’s made by WP Engine) which can help with this, or I would also recommend posting a task for a developer to test and confirm this before you make the switch, if you’re not comfortable with this.

Forgot to mention…

QUIC CLOUD (a litespeed cdn) is in beta currently that does both dynamic cdn caching (php etc) AND static cdn caching which is insanely fast….

I have tested it and using lscache, litespeed server, and quic cdn (dynamic and static caching) is substantially faster than lscache, litespeed server, and cloudflare static.

Give it try! My only recommendation is use it on test sites currently as it is in beta and i have experienced some bugs which have made me revert to cloudflare cdn until quic cloud is out of beta.

All the best,
Adam

It would be the fastest if you didn’t have 400kb of fonts loading! 🙂

To be honest, there’s this misconception that you can’t get fast speeds unless you shun shared hosting, but you can easily get 0.5 seconds using shared hosting and Cloudflare/Stackpath.

It’s all in the details or micro-optimisations, as you’d say.

Recently I got a perfect score on Lighthouse Chrome DevTools and revealed a Google Easter Egg. This is on an AMP site, but AMP is in fact SLOWER unless it’s served from an AMP cache by Google or Cloudflare.

Now just setting up a new site that’s regular WordPress, using GeneratePress and Elementor, as that’s the lightest combo I can find at 27.3 kb for stock WordPress and Premium GP.

For comparrison, stock Themify Ultra which includes Themify Builder is 160kb. To be fair to Themify, it’s easy to turn things off so it loads lighter, but why waste code turning features off? It’s like a double waste.

Good work, though. Thanks for the read.

This is currently running the alpha version of WordPress 5.4, and as a consequence, you will see it has the fonts loading from the 1.0 version of Twenty Twenty theme, unadulterated. i.e. anyone can achieve this, with stock theme. Removing the fonts would obviously make the overall payload lower. There’s a trade-off to be made there, similar to that described in the post itself. Most clients and end-users are selective and will have an opinion about fonts.

Ideally, I’d host a white page with only text, in arial 😉

omg, propagation of WP which is slow and not secure system, all is lie here..i create website over 10y in PHP and WP is my enemy..it’s for amaters..WP made just trash on internet

I’ve approved this comment because you just filled my bingo card 🙂

1) WordPress is slow – well, obviously not… how you landed here is you searched up the fastest website.
2) WordPress is not secure – nope. That’s like saying houses are not secure. Security is the job of the system administrator.
3) WordPress is for amateurs. No. I earn a very good living using WordPress every day.

WordPress is built with PHP. Just because you don’t like a tool doesn’t mean it isn’t useful. It doesn’t suit all purposes, but WordPress can load very fast, in professional hands.

Thank you for completing my Full House on the myths about WP bingo card. I feel like a big winner for Wednesday now 🙂

I did a post about page loading times as I was excited that on day 1 of first deployment and design of a new blog. I then did a search for “fastest website in the world” and guess what? I was very pleased with your article. I’m actually going to be moving my personal projects to a VM I have at a datacentre just 5 mins from my house in Manchester soon and the provider recommends a LEMP stack as it happens, and I couldn’t be happier with exploring this and moving my personal projects over in this way initially as I learn more about Nginx and Maria DB. I’ve downloaded Heidi SQL locally also on recommendation. Anyways, I love all the comments and esp. your replies! Really nailed it here for me, happy days!

OK, so plug time (if you’ll allow) I’d like to say that I put a link to your post as a comment on my recent blog post.

So without further adue, here is my post about page loading times:

https://dredevops.com/need-for-speed/

Info: I’m using the Hello theme from Elementor which is one of the fastest vanilla themes that I know of but I haven’t even started my optimisation journey yet. I’m excited get a result of 259 ms initially! Godspeed!

Hi Dre,

Best of luck! Elementor is a pretty good pagebuilder when it comes to optimization.

Be sure to check out AMP project – when it comes to Google’s PageSpeed Insights, you’ll find an all AMP site will score really high. I know not everyone loves AMP, but… well Google has some authority in the space. They are all-in on AMP.

Thank you Robin, much appreciated.

I was just searching to see if my post came up in the results for my own keywords, and yours showed up before mine ha ha! It reminded me to check and reply.

Aye, I would have seldom touched a page builder with a barge pole, then Elementor came along and changed the game.

I regularly attend the monthly Elementor and WordPress User Group meetups here in Manchester, which are of course online now (accessible to all).

In this month’s MWUG run by Mike Little (co-founder of WP) he talked about AMP and it seems certain that Google will favour an AMP story over a non-AMP story amongst other things. I’m glad you’ve mentioned it again, as it has prompted me to actually look into this framework. Exciting stuff!

First things first, I’m going to start looking into moving from Apache/Litespeed and MySQL to pure Nginx and Maria DB on recommendation from a provider that I trust who has provisioned me a CentOS VM which I’m going to play around with initiall (as I’m more familar with Ubuntu/Debian) and I’m fairly new to working at the command-line level without a panel/GUI. I may consider Plesk at some stage as a more “responsible” way to manage commercial projects whilst I’m learning as I want to move away from cPanel entirely (who needs such a bloated system right?)

p.s. It’s safe to say I’m a fan of yours now, as I can’t really fault a single thing you’ve said on this post and I love how you deal with and respond to comments. BINGO! 😉

Leave a Reply

Your email address will not be published. Required fields are marked *