Skip to content
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

Improve caching with Incremental Static Regeneration (ISR) on Netlify #300

Open
ViorelMocanu opened this issue Aug 11, 2024 · 0 comments
Open
Assignees
Labels
enhancement New feature or request ops Operational updates: configs, CI/CD, procedures, project
Milestone

Comments

@ViorelMocanu
Copy link
Owner

ViorelMocanu commented Aug 11, 2024

https://developers.netlify.com/guides/how-to-do-advanced-caching-and-isr-with-astro/

---
Astro.response.headers.set("Cache-Control", "public, max-age=300, s-maxage=3600");
// Sets the number of seconds to cache the page in the ☝️ browser and ☝️ the CDN
---

for slow to render pages, consider using:

---
// Tell the browser to always check the freshness of the cache
Astro.response.headers.set("Cache-Control", "public, max-age=0, must-revalidate");

// Tell Netlify's CDN to treat it as fresh for 5 minutes, then for up to a week return a stale version
// while it revalidates. Use Durable Cache to minimize the need for serverless function calls.
Astro.response.headers.set(
  "Netlify-CDN-Cache-Control", "public, durable, s-maxage=300, stale-while-revalidate=604800"
);
---
@ViorelMocanu ViorelMocanu self-assigned this Aug 11, 2024
@ViorelMocanu ViorelMocanu converted this from a draft issue Aug 11, 2024
@ViorelMocanu ViorelMocanu added this to the v0.5 milestone Aug 11, 2024
@ViorelMocanu ViorelMocanu added enhancement New feature or request ops Operational updates: configs, CI/CD, procedures, project labels Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ops Operational updates: configs, CI/CD, procedures, project
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant