Skip to content

[Website] Fix Safari loading stale index.html after deployments#3208

Merged
adamziel merged 1 commit intotrunkfrom
fix-safari-offline-cache
Jan 28, 2026
Merged

[Website] Fix Safari loading stale index.html after deployments#3208
adamziel merged 1 commit intotrunkfrom
fix-safari-offline-cache

Conversation

@adamziel
Copy link
Copy Markdown
Collaborator

Summary

Safari doesn't respect cache: 'no-cache' the same way Chrome and Firefox do. When fetching /index.html with no-cache, Safari would still serve the response from its HTTP cache. This caused problems after new Playground deployments—the stale cached index.html contained references to assets that no longer existed on the server, breaking the site.

This PR switches to cache: 'no-store' in all fetch operations, which makes Safari behave consistently with other browsers by always going to the network without checking the HTTP cache first.

Changes

  • Replace cache: 'no-cache' with cache: 'no-store' in networkFirstFetch()
  • Apply the same fix to cacheOfflineModeAssetsForCurrentRelease() and fetchFresh()
  • Add detailed comment explaining the Safari-specific behavior and why no-store is required

Test plan

  • Deploy to staging and verify Safari loads the latest version after deployment
  • Test that offline mode still works correctly in Safari
  • Verify behavior is unchanged in Chrome and Firefox

Safari doesn't respect cache: 'no-cache' the same way Chrome and Firefox do. When fetching /index.html with no-cache, Safari would still serve the response from its HTTP cache. This caused problems after new Playground deployments—the stale cached index.html contained references to assets that no longer existed on the server, breaking the site.

Switching to cache: 'no-store' makes Safari behave consistently with other browsers by always going to the network without checking the HTTP cache first. This ensures users get fresh assets after each deployment.
@adamziel adamziel changed the title Fix Safari loading stale cached assets after deployments [Website] Fix Safari loading stale cached assets after deployments Jan 28, 2026
@adamziel adamziel changed the title [Website] Fix Safari loading stale cached assets after deployments [Website] Fix Safari loading stale index.html after deployments Jan 28, 2026
@adamziel adamziel merged commit df142d9 into trunk Jan 28, 2026
35 checks passed
@adamziel adamziel deleted the fix-safari-offline-cache branch January 28, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant