Skip to content

Conversation

@markdembo
Copy link
Contributor

  • Explicitly state that Cache Reserve is not supported in Workers docs

Explicitly state that Cache Reserve is not supported.
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Sep 23, 2024

Deploying cloudflare-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 145e28e
Status: ✅  Deploy successful!
Preview URL: https://61ea8c76.cloudflare-docs-7ou.pages.dev
Branch Preview URL: https://mdembo-workerscachereserve.cloudflare-docs-7ou.pages.dev

View logs

:::caution[Tiered caching and the Cache API]

Cache API within Workers does not support tiered caching. Tiered Cache concentrates connections to origin servers so they come from a small number of data centers rather than the full set of network locations. Cache API is local to a data center, this means that `cache.match` does a lookup, `cache.put` stores a response, and `cache.delete` removes a stored response only in the cache of the data center that the Worker handling the request is in. Because these methods apply only to local cache, they will not work with tiered cache.
Cache API within Workers does not support tiered caching or use with Cache Reserve. Tiered Cache concentrates connections to origin servers so they come from a small number of data centers rather than the full set of network locations. Cache API is local to a data center, this means that `cache.match` does a lookup, `cache.put` stores a response, and `cache.delete` removes a stored response only in the cache of the data center that the Worker handling the request is in. Because these methods apply only to local cache, they will not work with tiered cache.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should tell people to use KV

@github-actions github-actions bot added size/m and removed size/xs labels Sep 23, 2024
@markdembo markdembo changed the title [Workers] Expliclity call out Cache Reserve incompatibility [Workers] Expliclity call out Cache Reserve incompatibility - WIP - DO NOT MERGE Sep 23, 2024
@KimJ15 KimJ15 assigned dcpena and unassigned kodster28 Sep 27, 2024
@dcpena dcpena removed the request for review from kodster28 September 27, 2024 15:46

## Using Cache API

The Cache API allows for a simple API to cache POST requests. However, Cache API does not [support the use of Tiered Caching or Reserve Reserve](/workers/reference/how-the-cache-works/#cache-api). To increase Cache Hit Rates and offload origin load, consider using Workers KV instead (see below).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
The Cache API allows for a simple API to cache POST requests. However, Cache API does not [support the use of Tiered Caching or Reserve Reserve](/workers/reference/how-the-cache-works/#cache-api). To increase Cache Hit Rates and offload origin load, consider using Workers KV instead (see below).
The Cache API allows for a simple API to cache POST requests. However, Cache API does not support the use of [Tiered Caching or Reserve Reserve](/workers/reference/how-the-cache-works/#cache-api). To increase Cache Hit Rates and offload origin load, consider using Workers KV instead (see below).

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggested which part of the text was included as the link to prevent potential confusion.


## Using Workers KV

KV allows
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know this PR is still a WIP so may get addressed later but this reads as incomplete for now.

@dcpena dcpena assigned ToriLindsay and unassigned dcpena Feb 10, 2025
@kodster28
Copy link
Collaborator

Closing this out b/c there's conflicts + hasn't been touched for quite a while.

feel free to re-open / bug me if this is in error.

@kodster28 kodster28 closed this May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:workers Related to Workers product size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants