Cloudflare Pages with fallback to Workers on 404?

Hello,

For performances reason, we’re interested to use CF Pages but if a page is not found, to call a Worker that could generate the page on-the-fly.
Pages is very interesting for us but limited to 20,000 files and 25MB for all pages.

The only solution that seems possible is to always have a Worker in front, then to fetch the content on CF Pages and do the fallback in the Worker. But this reduce the performance (flat HTML file vs running a Worker + fetch + return it)

Any idea ?
Regards

There wouldn’t be much of a performance loss. Either way, it’d be served from edge.

It would require a Worker running on all routes though. There is no way to fire a Worker on 404. Definitely an interesting use case.

1 Like

Thank for your reactivity @Walshy !

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.