-
Notifications
You must be signed in to change notification settings - Fork 34
Route Caching #1245
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
base: main
Are you sure you want to change the base?
Route Caching #1245
Conversation
Added cache configuration for routes in astro.config.ts and updated cache invalidation tag in webhook API.
|
I’d like to see a summary of the total cache along with a list of tags, so we can get an idea of what’s being cached or invalidated and catch any tags that might have been missed which allows us to easily debug. |
|
I'm not sure that's something for Astro to provide, feels like maybe it should be achievable through the driver platform (eg. cloudflare)? |
|
Exclusively for self-hosted servers, these metrics (memory, SWR settings, etc.) are provided in JSON format. I think they could be useful for storefronts that need to cache product listings. Other ideas, can it cache payload in gzipped or brotli? Thinking by 50% or more is worth saving and reduce latency. |
|
From the perspective of Sanity I think we'd like to automatically define cache tags since our backend provides them, regardless of how customers define their GROQ queries and how the data is fetched, it's fairly dynamic. For us if we can define a live loader that could call A blog post could be resolving an author reference. If the author reference is edited it should invalidate all post entries that use it. Since customers often fetch data from other sources than ours we can't make any assumptions on their For next.js we're able to do this by calling |
Summary
A platform-agnostic route caching API for Astro SSR pages that enables declarative cache control using web standards.
Examples
Basic route caching
Automatic dependency tracking
Links