SWR working as not expected
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 11.2k
- Forks
- 899
- Avg merge
- 2d 24m
- Merged PRs (30d)
- 40
Description
Environment
"engines": {
"node": "20.10.0"
},
"nuxt": "3.17.5",
Reproduction
Describe the bug
routeRules: { swr: 300 }
expectations:
cache-control: s=max-age: 300 state-while-revalidate
realty:
devTools - disable cache : true
cache-control: s=max-age: 300 state-while-revalidate
devTools - disable cache : false (second request)
cache-control: public, max-age=300, s-maxage=300
Sorry may be I don't know how browsers works or something else, but max-age (a.k.a. browser cahce) dangerous for my project, how can I resolve this?
Additional context
No response
Logs
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported Nuxt 3.17.5 behavior with routeRules configured as swr: 300, comparing cache-control headers with browser cache disabled and enabled. Done means the observed browser caching behavior is explained or corrected so the expected cache-control policy is clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nuxt, typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100