Support
Editor's Choice Forums

WordPress, but Faster

The https://linux.uk (and formerly https://linux.co.uk) website has been a dynamic website for many years, for the last 10+ running on Wordpress and before that on a platform called “Plone”. While on the one hand running on a dynamic platf...
The https://linux.uk (and formerly https://linux.co.uk) website has been a dynamic website for many years, for the last 10+ running on Wordpress and before that on a platform called “Plone”. While on the one hand running on a dynamic platform is great for flexibility and ease of use, when it comes to publishing content it can be a bit of a liability in terms of performance and security. Just to give this some context, generating the current home page can take maybe half a second, whereas serving a static copy of the generated page, maybe 1/1000th of a second (or less). Currently the site leans heavily on in-Wordpress caching, and asset caching provided by CloudFlare. So as of today, whereas the Linux.uk website is generated by Wordpress, it will now be served up as static pages. i.e. there will be a statically generated version of the site which will be updated each time a change is made to the dynamic copy. Net result being a much faster website that’s more difficult to compromise. makemestatic.drawio So the Wordpress instance can run anywhere with an Internet connection, say a desktop machine (currently running in a container). The MakeMEStatic crawler is either a service or a self-hosted low-power Linux server (also currently running in a container). There are a number of Git providers with free-tier static hosting services (Gitlab, GitHub and CloudFlare to name three) and many (many) Domain registries. So essentially this can all be done, with the exception of the domain name hosting, using free-tier services.

What’s needed to complete the recipie

  • The MakeMEStatic plugin for Wordpress
  • A free account with GitLab
  • A working domain name with a domain registrar (linux.uk in this instance)

The Process

  • Create a repository for your pages in the Gitlab control panel
  • Create a Gitlab access token in the Gitlab control panel
  • Install the MakeMeStatic plugin from the Wordpress control panel
  • Create a new instance in the MakeMEStatic admin panel
    • Enter your real domain name
    • Enter your Gitlab repository name
    • Enter your access token
  • Select and “Run” your profile, this will crawl your site storing the resulting static copies in your selected GitLab repository.
  • In your GitLab control panel, in Settings → General, change the “Pages” “Visibility” to everyone
  • In your GitLab control panel, in Deploy → Pages and add your domain name
  • Add the TXT record to your DNS as described by the GitLab control panel
  • Re-point your domain to the GitLab URL described by the GitLab control panel
And we’re live! … Ok, so a large site takes a while to crawl on the first pass, but each time you change something and re-run the profile, it will only re-sync the changes, which typically takes seconds. Alternatively you can set an automatic refresh in the profile so it looks for changes and automatically re-runs the profile in the background.

But Why?

Well, if you’re not into Wordpress, I guess it’s just another content management system. However, there are, depending on who you listen to, somewhere between 32M and 800M Wordpress websites currently active on the Internet. Being able to reduce hosting costs to ~ zero and increase the page delivery speed of these sites by 1000x, seems significant. I’m also looking forward to not getting pinged multiple times every single day because some bad actor has decided to try a denial of service attack, brute force login, hack login, vulnerability exploit etc etc.

But what about the dynamic stuff?

Well, on the https://Linux.uk site there isn’t so much, maybe one or two feedback forms. As long as you’re aware of the issues this isn’t so much of an problem. The MakeMEStatic plugin mangles web addresses as it makes static copies, so although it will present under the chosen domain name, when you try to submit a form it will back-reference the actual Wordpress site “under the hood”. So the plugin used on the Linux site (Contact Form 7) seems to continue quite happily without modification. (it uses AJAX/Javascript to post the form in the background). There are solutions to other issues like comments, I’m currently playing with a plugin called “WPDiscuz” which does a similar thing with regards to comments being posted in the background using Javascript, so these too will still work on a static site.

Testing

If anyone sees a problem with the new static site, please ping me and I’ll take a look. In the meantime if anyone out there has a Wordpress site (or wants one) and would like to give this a try, again please ping me and I’ll try to send you a copy of the plugin. I suspect there maybe many edge-cases I’ve yet to encounter so the more testers the better. 1 post - 1 participant Read full topic