-
Notifications
You must be signed in to change notification settings - Fork 0
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
caching only while fetching new records #39
Conversation
Reviewer's Guide by SourceryThis pull request modifies the service worker (sw.js) to implement a more efficient caching strategy. The changes focus on caching responses only when fetching new records, rather than pre-caching a list of URLs during installation. The new implementation also includes cache cleanup on activation. File-Level Changes
Tips
|
✅ Deploy Preview for typetocalculate ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Coverage Report
File Coverage
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @gokulk16 - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider a hybrid approach: pre-cache critical assets in the install event, while using runtime caching for other resources. This maintains offline-first benefits while optimizing cache storage.
- Improve error handling in the fetch event. Currently, error responses are cached. Consider adding more robust checks and fallback strategies for network failures.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.
Summary by Sourcery
Refactor the service worker to cache network responses immediately after fetching, removing the pre-caching of specific URLs during the install event. Introduce an activate event to clean up old caches.
Enhancements: