configuring-lazy-prefetch

Tune LazyLayoutCacheWindow extents to reduce frame drops during high-velocity scrolling.

472|16|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/skydoves/compose-performance-skills --skill configuring-lazy-prefetch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: configuring-lazy-prefetch
Source: https://github.com/skydoves/compose-performance-skills/tree/main/lists/configuring-lazy-prefetch
Command: npx skills add https://github.com/skydoves/compose-performance-skills --skill configuring-lazy-prefetch

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identify when to adjust the LazyLayoutCacheWindow to reduce frame drops during high-velocity scrolling by tuning ahead and behind extents.

Core Features & Use Cases

  • Tune ahead/behind cache windows via LazyLayoutCacheWindow(ahead, behind) plumbed through rememberLazyListState and used by LazyColumn (with @OptIn).
  • Use NestedPrefetchScope for items that host inner lazy layouts to warm inner content during the outer prefetch phase.
  • Follow prerequisites (Compose Foundation 1.9+ for cache window support; 1.10+ for pausable prefetch) and verify improvements with Macrobenchmark.

Quick Start

Measure frame timings and then implement a LazyLayoutCacheWindow with ahead and behind values plugged into rememberLazyListState and applied to your LazyColumn.

Frequently Asked Questions about configuring-lazy-prefetch

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce frame drops during high-velocity scrolling in Jetpack Compose?

Reduce frame drops by adjusting the LazyLayoutCacheWindow to tune ahead and behind extents, controlling how many items are prefetched during high-velocity scrolling in Jetpack Compose lazy layouts.

How do I prefetch items for nested lazy layouts in Compose?

Use NestedPrefetchScope to warm inner lazy layout content during the outer prefetch phase, ensuring nested items are precomposed before they scroll into view.

What Compose Foundation version is required for pausable prefetch?

Pausable prefetch requires Compose Foundation 1.10 or later, while basic LazyLayoutCacheWindow support requires Compose Foundation 1.9 or later.

How do I apply a custom cache window to a LazyColumn?

Plumb LazyLayoutCacheWindow(ahead, behind) through rememberLazyListState and apply it to your LazyColumn using the @OptIn annotation to enable custom prefetch extents.

How do I validate scroll performance improvements from lazy prefetch tuning?

Validate lazy prefetch improvements by using Macrobenchmark measurements to measure frame timings before and after adjusting the cache window extents.

Why is my nested lazy layout still dropping frames during fast scrolling?

If nested lazy layouts drop frames during fast scrolling, ensure you apply NestedPrefetchScope to warm inner content during the outer prefetch phase and verify pausable prefetch is active on Compose Foundation 1.10+.