Hi @pradeepmc1 ,
Pls Follow Below Steps to Control Cache in EDS:
Step 1: Identify Your Project Type
Are you using:
- Google Drive/OneDrive ➜ Use .helix/headers file
- GitHub Repo ➜ Use helix-routes.yaml file
Step 2: For Google Drive/OneDrive Projects
- Create a file named .helix/headers in your drive.
- Add below lines to control caching for your pages:
/path/to/page.html
Cache-Control: public, max-age=3600, stale-while-revalidate=60
- This sets:
- Cache duration = 1 hour (3600 seconds)
- Allows stale content for 60 seconds during revalidation
Step 3: For GitHub Repo Projects
- Open your GitHub repo.
- Create or update helix-routes.yaml in root.
- Add this configuration:
version: 1
static:
- path: "/**"
headers:
cache-control: "public, max-age=3600, stale-while-revalidate=60"
- This applies cache to all pages. Modify path as needed (/about.html, /blog/**, etc.)
Step 4: Validate Cache Header is Applied
- Deploy your site (EDS).
- Open site in browser ➜ DevTools (F12) ➜ Network tab.
- Select a page ➜ Check Response Headers.
You should see:
Cache-Control: public, max-age=3600, stale-while-revalidate=60
Step 5: No Cache (Optional)
If you don’t want any caching, use this instead:
Cache-Control: no-cache, no-store, must-revalidate
Regards,
Amit