So, i have a page that is updated via turbo streams. So, a click is linked and page is updated no problem there.
This just came in my mind, is it possible to cache the views in such a way that the turbo stream does not update the parts of the page unless it was changed(updated)?
If you have to fetch (or stream) the frame contents to determine if its different, the only reasons I can think of to not replace the DOM with it would be if it contained inputs or focus.
You could stream to a different (hidden or outside of body) frame and code whatever reasoning you required to move to the visible DOM
As you can see in the video, the skeleton loaders are reloading everytime and it makes sense because each time the conversation was clicked, it submits a turbo stream request to update the page.
I was wondering if it’s possible to somewhat allow them to be cached such that the skeleton loaders don’t load after the initial load. I thought about disabling the active conversation for sometime, but i was wondering if it was possible with streams. Thanks
I recommend using turbo-frame over turbo-stream for this.
When not altering state on the backend, GET request is recommended
You can speed up GET requests with eTags.
This would speed up the responsiveness of the page. I might also consider one these options:
delay showing the participant skeleton a few hundred milliseconds. If the participant html loads before the skeleton loads, then you never see the skeleton.
consider removing the participant skeleton for this area. I’ve found that in some areas, the skeleton technique does not always turn out and I remove it.
@tleish sorry for bothering again. But, i’ve worked on what you proposed and it already got me far where i want to be.
One thing is. Do you know how to update urls when navigating towards a frame?. I’ve modefied the links to target the specific frame. They UI is updated successfully, but the url is not. When i click on a conversation on the left side the url is not updated successfully. But, the rendered frame from the server has the correct src.