configuring-lazy-prefetch

Configure Jetpack Compose lazy layouts with LazyLayoutCacheWindow and pausable composition.

8|Updated May 18, 2025
One-click install
npx skills add https://github.com/decoutkhanqindev/DexReader --skill configuring-lazy-prefetch-decoutkhanqindev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: configuring-lazy-prefetch
Source: https://github.com/decoutkhanqindev/DexReader/tree/main/.claude/skills/configuring-lazy-prefetch
Command: npx skills add https://github.com/decoutkhanqindev/DexReader --skill configuring-lazy-prefetch-decoutkhanqindev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires androidx.compose.foundation, and includes scripts (resource) components.

What problem does it solve?

This Skill addresses performance bottlenecks in Jetpack Compose apps, specifically related to the efficient prefetching of UI elements during scrolling.

Core Features & Use Cases

  • Configure LazyLayoutCacheWindow: Adjusts the cache window to control the number of items pre-composed.
  • NestedPrefetchScope: Implements nested prefetching for items with inner lazy layouts.
  • Pausable Composition: Utilizes pausable composition to enhance scrolling performance.
  • Use Case: When you experience dropped frames at high scroll velocities in your Jetpack Compose app, this Skill helps optimize performance by adjusting the prefetching settings.

Quick Start

To enable pausable composition for your LazyColumn, use the following code:

val state = rememberLazyListState(cacheWindow = LazyLayoutCacheWindow(ahead = 200.dp, behind = 100.dp))
LazyColumn(state = state) { ... }

Frequently Asked Questions about configuring-lazy-prefetch

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

FAQPage Schema
How do I fix dropped frames during high velocity scrolling in Jetpack Compose?

To fix dropped frames during high velocity scrolling in Jetpack Compose, configure advanced lazy layout prefetch settings like LazyLayoutCacheWindow and pausable composition to optimize UI element pre-composition and enhance scrolling performance.

How do I configure LazyLayoutCacheWindow for a LazyColumn?

You configure LazyLayoutCacheWindow by passing it to rememberLazyListState, specifying ahead and behind distances like 200.dp and 100.dp, which controls the number of items pre-composed during scrolling.

Does pausable composition require a specific Jetpack Compose version?

Pausable composition requires Jetpack Compose 1.10 or higher, while configuring the LazyLayoutCacheWindow for lazy layouts requires Jetpack Compose 1.9 or higher to function properly.

What is pausable composition in Jetpack Compose?

Pausable composition in Jetpack Compose is an advanced prefetching mechanism that allows lazy layouts to pause and resume UI element composition, specifically targeting performance bottlenecks at high scroll velocities.

How do I optimize nested prefetching for inner lazy layouts in Compose?

You optimize nested prefetching in Compose by implementing NestedPrefetchScope, which manages prefetching for items containing inner lazy layouts to improve overall scrolling performance.