Turbo Frames lazy loading request count for low-traffic Rails pages
0 reputation · 28 May 2026, 03:06 UTC
Turbo Frames support deferred loading through the loading='lazy' attribute on turbo_frame_tag in Rails 7.1 and later. The objective is to lower initial-page bandwidth and server requests for a low-traffic workload by fetching offscreen frame content only when it enters the viewport.
Each lazy frame currently issues an independent HTTP GET to its src URL on scroll, and Turbo does not include a built-in option to batch or merge multiple frame fetches into one response. Fragment caching and Cache-Control headers work per endpoint, but request volume still grows with the number of frames on the page.
Can multiple lazy Turbo Frame fetches be consolidated into a single request through any supported configuration? Should above-the-fold frames use loading='eager' while only secondary sections defer loading, and how does that choice affect authenticated endpoints and search-engine indexing?