Cloudflare Pages build caching

A Cloudflare engineer (dario-piotrowicz (Dario Piotrowicz) · GitHub) is interested in working on adding persistent build caching for Hugo projects deployed on Cloudflare Pages. This is something they already offer for some frameworks, but not yet Hugo.

On the Cloudflare Discord, he asked to connect with a Hugo maintainer to make sure he gets things right.

Are there any Hugo maintainers who might be interested/available to help with this?

Apologies if this is not the right venue for a request like this. I considered opening an issue on Github, but this seemed more appropriate.

Here’s a link to the thread on Discord.

And I’m attaching a screenshot too just in case that link doesn’t work:

The only Hugo maintainer is @bep (with support from @jmooring etal.)

Well if @bep or @jmooring are willing to be available to answer any questions from Dario, my Cloudflare Pages deployment times will be improved by an order of magnitude. :joy:

link to conversation

Thank you for your help, @jmooring !!

I’ve asked again. While Dario from CF is quick to respond, unfortunately there’s still no progress, and it doesn’t sound like there will be.

My GH workflow includes a Cache Action that caches the resources folder, allowing for quick builds (not as fast as locally, but good enough).

Hi @alcarazr , that’s smart. Thanks for pointing me in that direction! I’ll try that

A little late to the game here, but I did some investigation, and I could make it work with a terrible hack making my project “look like a Eleventy project”:

With the above, the build time for this gallery site went down from 15s to 100ms.

But what a grimy hack, but it at least shows that it should not be too hard for Cloudflare to make this happen also in custom builds.

This is supposed to be fixed by [Pages] Add Hugo to build caching frameworks by ericclemmons · Pull Request #29687 · cloudflare/cloudflare-docs · GitHub

I don’t think it’s live yet (I tested).