Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pages/cloudflare/caching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ export default defineCloudflareConfig({

#### Queue

A queue must be setup for projects using revalidation (either Time based or On-demand).
A queue must be setup for projects using Time-Based revalidation.
It is not needed when revalidation is not used nor only On-Demand revalidation is used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think i know why there was a mention of On-demand, res.revalidate use the same binding that the one used by the queue. We only talk about it in the queue part of the docs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you suggest to update the the doc as:

-A queue must be setup for projects using Time-Based revalidation.
+A queue must be setup for projects using Time-Based revalidation or `res.revalidate` (Page Router)
It is not needed when revalidation is not used nor only On-Demand revalidation is used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could put it here, but it's not actually the queue that is needed it's only the binding itself.
Maybe we don't need the fix anymore actually, since now fetch are public if i'm not mistaken (We had to use the binding, but now it can just be a fetch, which i think is the default)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had to use the binding, but now it can just be a fetch, which i think is the default

The binding will always be faster than a public fetch as it will skip part of the Cloudflare infra.
So we decided to keep using the binding for internal code to benefit for the improved perf.

I'll double check what we do currently.


**Configure the queue**

Expand Down Expand Up @@ -719,6 +720,11 @@ This component can either call the Cache API's purge function directly or route

Cache purge are only called when you call `revalidateTag`, `revalidatePath` or `res.revalidate` in the pages router. It is not called for ISR revalidation.

To use cache purge, you need to define the following wrangler secrets:

- `CACHE_PURGE_API_TOKEN` should be set to [an API token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/) with the `Cache Purge` permission
- `CACHE_PURGE_ZONE_ID` should be set to the [zone ID of your deployment domain](https://developers.cloudflare.com/fundamentals/account/find-account-and-zone-ids/)

Below is an example configuration for integrating the cache purge component in your `open-next.config.ts`:

```ts
Expand Down