The mobile shell is pinned to the visual viewport, and a deploy is never cached - #332
Merged
Conversation
… is never cached Two faults, and the first hid the second. Static files were all served with max-age=0, so a phone could hold a stale shell after a deploy while two megabytes of fingerprinted JavaScript were revalidated on every load. The plugin writes that header itself after any setHeaders hook, so its own handling is now off: a file under assets carries its content hash and is cached for a year and never revalidated, and the HTML shell that names those files is never cached, so a deploy lands on the next load with nothing to clear. The phone layout asked a chain of percentage heights to agree with a viewport that changes size as iOS slides its toolbars, and it did not: the bottom bar left the screen and the thread ran under the browser chrome. The app is now a fixed element pinned to the visual viewport, which is the one arrangement iOS keeps correct through that transition. Out of flow, the page has nothing to scroll, and each view scrolls inside itself.
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.
Two faults, and the first hid the second.
Caching. Every static file was served
public, max-age=0: a phone could hold a stale shell after a deploy, while two megabytes of fingerprinted JavaScript were revalidated on every load.@fastify/staticwrites that header itself after anysetHeadershook, socacheControl: falseis required for ours to stand. Now/assets/*(content-hashed names) ispublic, max-age=31536000, immutableand the HTML shell isno-store, must-revalidate, so a deploy is picked up on the next load with nothing to clear. Verified on the live server.Mobile shell. The layout asked a chain of percentage heights to agree with a viewport that changes size as iOS slides its toolbars; it did not, so the bottom bar left the screen and the thread ran under the browser chrome.
.appis nowposition: fixed; inset: 0; height: 100dvhunder the 760px breakpoint, which is the arrangement iOS keeps correct through that transition. Out of flow, the page has nothing to scroll and the bottom bar cannot be carried away; views scroll inside themselves as before. Confirmed present in the built CSS.