This article is written in broad terms and aimed towards our clients (Hi!). I will be documenting the technical aspects of the set up for developers in the coming weeks.
Over the last few months I have been testing ‘serverless’ WordPress builds and am now giving new clients the option to opt-in to this type of hosting.
Most people ‘get’ how a bog-standard monolithic server works. Your files, database and content mangement system all live on one server. People access that server.
There are three obvious downsides to this type of set up.
www.domain.tld
can also have a crack a exploiting access to www.domain.tld/admin
.My approach to serverless hosting moves the content-managed WordPress install into its own hidden sub-directory. This is accessible only to the content managers and site administrator.
www.domain.tld/wp-admin
> wp.domain.tld/wp-admin
Anyone now looking to exploit WordPress at www.domain.tld/wp-admin
is not going to find anything.
From your perspective you now have staging server at wp.domain.tld/wp-admin
which you can use to manage content exactly as before.
The only difference is that any changes you make on the staging domain will not be public until you ‘deploy’ them to the public www.domain.tld
site.
When you do this the server runs a script that scans every page of your site and generates a static version (similar to how a caching plugin would work).
While this process can take several minutes depending on the size of the site, once you click deploy the server will continue to deploy the changes regardless of you babysitting it. You can log out and get a cup of tea.
Once the deploy script is complete the changes to your site are pushed out to dozens of servers across the content-delivery-network.
When users try to access the now pre-cached site they access it from the nearest geographic location.
Typically I am seeing pages loaded around three times faster using this method vs a standard LiteSpeed cached WordPress install.
Yeah. There is a catch.
Taking this approach breaks the connection between WordPress and the public site.
Any forms ( i.e. contact forms, ecommerce functionality, search functionality ) that either feeds information back into WordPress, or queries WordPress on the fly, will not work.
This isn’t the end of the world for any simple forms. Basic contact forms can be migrated to Basin (which is excellent) but more complicated functionality that adds content to the WordPress database (for example comments or ecommerce functionality) will not work.
—