cloudflare / cloudflare/cloudflare-docs

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

Open
#20,445 2 comments 2 reactions 1 assignee Assigned to @korinne View on GitHub
content:edit documentation product:pages product:workers stale
Dominant language
MDX
Stars
5.2k
Forks
16.7k
Avg merge
2d 6h
Merged PRs (30d)
337

Description

### Existing documentation URL(s)

- https://developers.cloudflare.com/workers/static-assets/compatibility-matrix/
- https://developers.cloudflare.com/pages/configuration/serving-pages/#caching-and-performance

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.