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

Offline cache #2508

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
5xx handling
  • Loading branch information
corrideat committed Jan 19, 2025
commit 29efb803fe6d16f568ca2870efd6eb44c875651e
5 changes: 4 additions & 1 deletion frontend/controller/serviceworkers/cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ if (
await cache.put(request, response.clone()).catch(e => {
console.error('Error adding request to cache')
})
} else {
} else if (response.status < 500) {
// For 5xx responses (server errors, we don't delete the cache
// entry. This is so that, in the event of a 5xx error,
// the offline app still works.)
await cache.delete(request)
}

Expand Down