-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Turbo-frame caching doesn't seem to work when preloading frame links. #857
Comments
Thank you for opening this issue! At the moment, pre-loading turbo/src/core/drive/preloader.ts Lines 37 to 53 in f04a21c
What's crucially missing here is the If we were to support that, the
At any point in that traversal, the That logic exists throughout Turbo, as it's what powers Turbo Frame navigation. With that being said, there isn't a centralized location or method for the Even if that were available, I'm not sure of the implications of writing the response HTML to the |
@seanpdoyle thank you for the detailed reflection on the state of things. I'm on like "Day 2" of learning Hotwire, so I'm still very much finding my sea legs for how this all fits together. Your point about frames responses often omitting much of the layout showcases the complexity of this stuff. Just spit-balling here, but perhaps the <turbo-frame id="my-frame">
<a href="..." data-turbo-preload="my-frame">Do the thing</a>
</turbo-frame> ... it could point to a frame-specific cache (something like Anyway, just thinking out load with basically no historical context 😆 I'm just excited to start learning more about this stuff. |
I just wanted to share a write-up that I did of the task I was trying to accomplish: A Simple Slide Show Using Hotwire And Lucee CFML . Obviously, it doesn't have the |
@seanpdoyle It sounds good, though the code is a bit over my head. It's been a while since I've thought about this stuff. I've been focusing on other things, but will get back to Hotwire soon. |
@bennadel thank you! A portion of that diff is related to housekeeping, and involves a lot of implementation details. The clauses that happen to exclude Turbo Frames are in this portion: https://github.com/hotwired/turbo/pull/1033/files#diff-1a0b7d769d04149117769a2bb8e5b27af85123be3c37e31f5790113c827a1962R132-R147 |
@seanpdoyle Hmmm, that makes it look it won't preload if the link is inside a tubro-frame ( |
@bennadel Did you manage to solve your slideshow cache issue somehow? I'm having a similar problem with my navigation menu containing dynamically loaded sub-menus. The problem is that every time the user navigates to the sub-menu he has to wait for the server response which makes the menu slow. Looks like frame navigation is not cached. |
This was closed by #1033. Prior to 1033, support for Turbo Frames could be expected, but based on #857 (comment), I think it'll require some more consideration before committing to that support. #1033 incorporates guards to reject Turbo Frames. I think pre-loading frames is viable, and worth exploring separately. @afcapel if we think that's important for v8, we could re-open this issue. |
I raised this issue on the dev forum, and it was suggested that I open an Issue here - apologies if this is not the correct course of action.
I am attempting to use a
<turbo-frame id="..." data-turbo-action="advance">
in conjunction with some embedded links that preload the content,<a href="..." data-turbo-preload>
.Here's what I do see:
<a>
tag content immediately when the page loads.What I don't see:
turbo:render
events (documentation says one should fire for the preview and then another for the fresh content).Here's a truncated version of the code that I am running - it's intended to be a "slide show" kind of thing for quotes:
Over on the dev forum, someone indicated that caching for turbo-frame links works ... but, not in conjunction with
data-turbo-preload
. Thanks for any help you can offer!The text was updated successfully, but these errors were encountered: