gatsby
gatsby copied to clipboard
Fix: Gatsby-Plugin-Offline Double Reload Issue
Issue: The Gatsby-Plugin-Offline requires two reloads to properly cache and serve the index page, causing a blank screen on the second reload.
Solution:
1. Updated service worker logic to cache the index page and component-src files on the first load.
2. Ensured service worker correctly responds to requests with cached resources.
Documentation:
• Updated caching logic documentation in the plugin’s README.
Tests
• Added unit tests to verify the correct caching of index and component-src files.
• Performed manual tests to confirm the offline experience works without requiring double reloads.
Related Issues
• Fixes #39041
@jhanstra #39041 #39042 / Duplicate of #
@emmron This PR is very large and unwieldy, updates unrelated code, and it isn't clear to me what it's solving. To be honest it looks like it may even have been AI generated, and it looks very similar to https://github.com/gatsbyjs/gatsby/pull/39050. I'm going to close it, but please feel free to open smaller, more easily reviewable PRs.