[5.x] Improve turbo frame caching - #1329
Open
Jade-GG wants to merge 6 commits into
Open
Conversation
Jade-GG
force-pushed
the
feature/turbo-frames
branch
from
August 24, 2026 07:02
d4ff2e5 to
0a056e4
Compare
Jade-GG
marked this pull request as ready for review
August 24, 2026 07:03
Collaborator
Author
|
Depends on rapidez/blade-directives#24 |
Collaborator
Author
|
Playwright errors caused by:
|
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.
ref: RAP-1969
This PR adds some basic standardized functionality for turbo frames, which allows us to improve the caching, adding the cachekey into the url. This solves the issue of turbo frames staying in cache longer than necessary when you clear the cache, which then in turn also often ended up causing a cache loop.
For this purpose, I've added a directive that can be used to insert turbo frames. It should be used like this in templates:
This then places the intended view with the
$completevariable set tofalsedirectly on the page, and creates a turbo frame that will overwrite this with the same view but with$completeset totrue.For example, say you have a view included somewhere that looks like this, with one very heavy query:
We could change the
@includeto a@turboframe, and then modify the view like so: