-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turn off cache? #15
Comments
@kotx thanks! I think (b) is for the Cloudflare CDN cache and not the worker’s internal cache. |
Are you sure the cache is not shared? The Cache API that the worker uses should allow at least purging by tag, host, or prefix. Purging by URL should also work, but I'm not sure on the wording. Take a look at the documentation for details. |
I'm not sure at all, to be honest, the docs suggested to me that they were different. If they are the same cache then they could probably be deleted programmatically using the Cloudflare API. Something like this: await fetch(
"https://api.cloudflare.com/client/v4/zones/aa7f1c06205063c0a3b298060d716e7f/purge_cache",
{
body: JSON.stringify({
files: [pathToDelete],
}),
headers: {
"Content-Type": "application/json",
// auth headers
},
method: "POST",
}
); |
If an object in R2 is deleted then the cache still serves the old file. Even if I upload a new file at the same path then the old file is still served.
I suggest a way to either (a) opt-out of the cache completely, or (b) provide some way to manually invalidate the cache. Any ideas? Particularly ideas for (b)?
The text was updated successfully, but these errors were encountered: