Skip to content

Ensure page refreshes cause a reload when assets change#1146

Merged
afcapel merged 1 commit intomainfrom
stale-assets
Jan 31, 2024
Merged

Ensure page refreshes cause a reload when assets change#1146
afcapel merged 1 commit intomainfrom
stale-assets

Conversation

@afcapel
Copy link
Copy Markdown
Collaborator

@afcapel afcapel commented Jan 30, 2024

Fixes #1105
Fixes #1116

Copy link
Copy Markdown
Collaborator

@kevinmcconnell kevinmcconnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Nice that the fix was straightforward! And logically, it makes sense that the morph renderer is a type of page renderer; I think it’s expected that they would have behaviour in common.

@afcapel afcapel merged commit 063d556 into main Jan 31, 2024
@afcapel afcapel deleted the stale-assets branch January 31, 2024 09:15
afcapel added a commit that referenced this pull request Feb 21, 2024
Fixes a bug introduced in #1146

`exemptPageFromPreview()` adds a `<meta>` tag to the `<head>` setting
`turbo-cache-control` to `no-preview`. However, since the MorphRenderer
now inherits from the PageRenderer, it can update meta tags in the head
and remove the `turbo-cache-control` tag. This means that the snapshot
cache will be used for the next visit, which is not what we want.

Specifying `shouldCacheSnapshot: false` in the `visit` options ensures
that the snapshot cache is not used for the refresh visit.
afcapel pushed a commit that referenced this pull request Feb 21, 2024
Fixes a bug introduced in #1146

`exemptPageFromPreview()` adds a `<meta>` tag to the `<head>` setting
`turbo-cache-control` to `no-preview`. However, since the MorphRenderer
now inherits from the PageRenderer, it can update meta tags in the head
and remove the `turbo-cache-control` tag. This means that the snapshot
cache will be used for the next visit, which is not what we want.

Specifying `shouldCacheSnapshot: false` in the `visit` options ensures
that the snapshot cache is not used for the refresh visit.
Challenge-Guy pushed a commit to Challenge-Guy/turbo-cfm1 that referenced this pull request Mar 8, 2025
Fixes a bug introduced in hotwired/turbo#1146

`exemptPageFromPreview()` adds a `<meta>` tag to the `<head>` setting
`turbo-cache-control` to `no-preview`. However, since the MorphRenderer
now inherits from the PageRenderer, it can update meta tags in the head
and remove the `turbo-cache-control` tag. This means that the snapshot
cache will be used for the next visit, which is not what we want.

Specifying `shouldCacheSnapshot: false` in the `visit` options ensures
that the snapshot cache is not used for the refresh visit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

turbo-visit-control isn't respected with morphing Page refreshes: Reloading When Assets Change is not being handled when morphing

2 participants