I have a frame that has the src attribute added after visiting a link within the frame. When I navigate away from this page and then navigate back using forward/back buttons, the frame is re-loaded from server. I don’t want this to happen, is there a way to prevent frames from automatically appending the src attribute on them or prevent this automatic request from the frame happening when loading a page from the turbo cache? Some of these frames I want to be cached and available on cache reload, so disabling caching on them won’t work. Thanks!
As I’ve been digging into Hotwire, I feel like my Turbo-Frames don’t reload when using the Back-button. I wonder if I’m on a newer version of Hotwire? Maybe this is something that has changed in recent releases. As far as wanting to keep some frames around, I’ve found that if I had a data-turbo-permanent
attribute on a <turbo-frame>
, it won’t reload the next time I visit that page, so that might be something you want to explore.
This certainly doesn’t happen for my lazily loaded turbo-frames that trigger on tab visibility.
I’m not manipulating the src attribute but afaik turbo caches the page as you are leaving so your src manipulation should be present. Could you be retriggering the link click handler again somehow ?