Skip to content

Clarify caching difference between Cloudflare Workers with Static Assets and Cloudflare Pages advanced mode #20445

@rmarscher

Description

@rmarscher

Existing documentation URL(s)

What changes are you suggesting?

I have found a difference betwee Cloudflare Workers with Static Assets and Cloudflare Pages advanced mode function that I think is not well documented. Cloudflare Pages advanced mode functions run AFTER the Cache Rules while Cloudflare Workers run BEFORE the Cache Rules.

The docs for Cloudflare Pages allude to this - https://developers.cloudflare.com/pages/configuration/serving-pages/#caching-and-performance

Just make sure that your caching does not interfere with any redirects or Functions.

With Cloudflare Pages advanced mode functions, I can do SWR with Cache Rules.

With Cloudflare Workers, this is not possible. My worker always executes.

It would be nice if this was more clearly documented. It would be really nice if there was an option for Cloudflare Workers to execute after Cache Rules. Then you could deprecate advanced mode for Cloudflare Pages and direct everyone to Cloudflare Workers with Static Assets.

Thank you.

Additional information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions