markjgsmith

Incremental progressive rendering

2024-05-29 10:46:00 +07:00 by Mark Smith

Incremental progressive rendering is a feature I've been working on for the static site generator. It's a mode that you can enable which should enable you to drastically reduce build times if you have a content cache.

It adds a check of each template's output locations, and only renders the output file if no output file currently exists or if the output file present has an older last modified time than the source template.

When you have a content cache, and enable incremental progressive rendering, then the generator will only render out new content templates that have been added since your last build. A content cache is essentially the base output directory. By default this is the dist directory.

If you are running locally, you don't have to do anything, just re-running the generator without deleting the dist directory. In automated build systems like Github Actions it's often possible to setup a cache. This will keep a backup of the dist dir and restore it before each build.

If your site has many thousands of files, then it will speed up the build time since it skips all renders except for the latest templates added.

At the time of writing this post the feature is work in progress and not merged into main yet.

For enquiries about my consulting, development, training and writing services, aswell as sponsorship opportunities contact me directly via email. More details about me here.