Documentation and patterns for implementing multi-layer caching, cache invalidation, and parallel fetching in Cloudflare Workers and Frontend JS.
This skill provides a comprehensive approach to optimizing Cloudflare Workers and web applications for high performance. It covers caching at the Worker memory level, the Cloudflare Edge, and frontend parallelization.
Promise.all) reduces the overall wait time for the user.Map in the module scope to store KV results for short durations (e.g., 30s).caches.default API to store full Response objects at the Cloudflare Edge.POST, PUT, or DELETE request is successful, use cache.delete() on the specific API URLs that were modified.const site = await fetchSite();
const products = await fetchProducts();
const [site, products] = await Promise.all([fetchSite(), fetchProducts()]);
public, max-age=86400, s-maxage=31536000, immutablepublic, max-age=15, s-maxage=60, stale-while-revalidate=120no-storeSee the templates/ directory for ready-to-use boilerplate.