Comments (4)
a), in wrangler.toml
:
# The `cache-control` header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control.
# Optional, the `cache-control` header is omitted if unset, which would NOT disable caching: https://developers.cloudflare.com/workers/runtime-apis/cache/#headers
# For example, you can disable all cache by setting this to `no-store`.
CACHE_CONTROL = "max-age=86400"
So just set it like CACHE_CONTROL = "no-store"
b)
You can manually invalidate the cache by going to the Cloudflare dashboard and purging the cache for URL(s) in a zone like so:
from render.
@kotx thanks! I think (b) is for the Cloudflare CDN cache and not the worker’s internal cache.
from render.
@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.
from render.
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",
}
);
from render.
Related Issues (15)
- 0-byte files cause issues HOT 6
- Configuring CORS (Access-Control-Allow-Origin) HOT 5
- Music playing CORS/Cache/worker error HOT 4
- Cache hit ignored for 304 response HOT 2
- Remove `range-parser` dependency HOT 2
- List items in bucket HOT 13
- Etag needs to be quoted? HOT 2
- Add Edge-Side-Includes HOT 1
- Chinese characters may display as garbled text HOT 6
- File Not Found HOT 3
- how to upload HOT 2
- cache.put always fired HOT 2
- site showing errors always in the first requests to a file HOT 3
- "wrangler publish" fails, "Error: missing field `type`" HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from render.