Fixes browser cache handling for generated msdf files#700
Open
uguraslan wants to merge 1 commit into
Open
Conversation
Test Results: ✅ PASSEDRun at: 2026-07-05T20:47:07.427Z Summary: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The dev server's
configureServermiddleware sendsCache-Control: public, max-age=31536000, immutablefor generated MSDF font files.immutabletells the browser the response will never change, so once the files are cached, a normal reload will not request it again even after any change occurs in.ttf/.config.jsonfiles and the plugin regenerates files again server-side. Only a hard reload (empty cache) gets the updated files.This fix replaces
immutablewithno-cacheplusETag(content hash). The browser still caches the response but always revalidates: unchanged fonts get served from its own cache via a304, changed fonts trigger a full fetch.I verified manually in blits-example-app: changed a font's
.config.json, confirmed a normal reload now gets the regenerated atlas automatically, and confirmed a reload with no font changes still returnsHTTP 304instead of re-download.Etagimplementation should work even very old browser versions.