Repository navigation
Commit 8a2542d
committed
fix: change Cache-Control from max-age to no-cache for proper ETag validation
Root cause identified from network logs:
- Browser was serving from disk cache without checking server
- max-age=300 allowed browser to cache for 5 minutes without revalidation
- Even with must-revalidate, browser only checks AFTER max-age expires
- This caused stale data to be served from disk cache
Solution:
- Changed to: Cache-Control: private, no-cache, must-revalidate
- no-cache forces browser to revalidate with server on EVERY request
- Browser can still cache, but must check ETag first
- If ETag matches, server returns 304 (fast, no body)
- If ETag differs, server returns 200 with fresh data
This ensures immediate cache invalidation when user data changes
while still benefiting from ETag-based 304 responses.1 parent 744f0da commit 8a2542d
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| |||
0 commit comments