You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Git repo to version the source code of the client (templates + images + CSS + maybe JS components)
Builder (Gitlab CI runner, AWS Lambda or OpenWhisk function, ...) to build the website by injecting the data into the templates and then push the static files to the Web server. The build can be triggered by:
a new commit in the git repo
a data update in any of the data source tracked by the website
the builder code knows what are the data sources to keep an eye on
Web server (CDN or static file server) to serve HTML and assets to the browser
[Optionnal] Ajax code that can still directly request the data source(s) for fancy features difficult to achieve in full static mode
Pros
good separation of data management and client code
easier to scale in case of high traffic (only the webserver has to scale)
renders faster in the browser (no ajax calls to wait for)
a bit more fault tolerant from the visitor point of view, the website is down only when the webserver is
Cons
more components to coordinate (devops to the rescue!)
Pain points
Mechanism to trigger a build on any data source update
How to achieve that ?
Constraint: a wordpress server can not be aware of who are the clients (here the builders) that consume its data (open bar decentralization hey!). So the server can not POST a message (webhook) to trigger a list of specific builders. In the other hand the git server can do that because there is a 1-to-1 relationship between a git repo and a website.
Ideas
Polling: the Builder periodically query each of its data sources and trigger a build if the data changed
Publish/Subscribe: Wordpress publish a message in a channel on each data update, any external Builder can subscribe to this channel and trigger a build when a message is published
Keep in mind
Static = build on each update (of data or source code)