generators-image-loading

Cache remote images in SwiftUI with deduplicated downloads and LRU disk storage.

4|1|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/AutisticAF/claude-code-apple-dev-plugin --skill generators-image-loading
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generators-image-loading
Source: https://github.com/AutisticAF/claude-code-apple-dev-plugin/tree/main/skills/generators-image-loading
Command: npx skills add https://github.com/AutisticAF/claude-code-apple-dev-plugin --skill generators-image-loading

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Generate a production-ready image loading pipeline with memory cache, disk cache (LRU), request deduplication, and a drop-in CachedAsyncImage SwiftUI view to replace slow, uncached image loading.

Core Features & Use Cases

  • Memory caching with NSCache for fast, automatic eviction under memory pressure
  • Disk caching with an LRU strategy to persist images across launches
  • Request deduplication to ensure a single download for concurrent requests to the same URL
  • Optional image processing (resize, thumbnails) and easy integration with SwiftUI lists and grids
  • Drop-in replacement for AsyncImage via CachedAsyncImage for production apps
  • Built-in tooling and tests to help verify cache behavior in local development

Quick Start

Replace AsyncImage in your SwiftUI views with CachedAsyncImage(url: ..., processing: ...) to enable automatic caching and optional image processing.

Frequently Asked Questions about generators-image-loading

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

FAQPage Schema
How do I cache remote images in SwiftUI to improve scrolling performance?

Request deduplication for image loading coalesces concurrent requests for the same URL into a single download. This prevents duplicate network traffic when multiple SwiftUI views attempt to load the identical remote image simultaneously.

How does disk caching with LRU work for SwiftUI image loading?

Disk caching with an LRU strategy persists images across app launches by automatically evicting the least recently used images when storage limits are reached. This ensures offline access to previously loaded remote images.

Does NSCache automatically handle memory pressure for SwiftUI image caches?

Yes, NSCache provides memory caching with automatic eviction under memory pressure. This allows the image loading pipeline to quickly serve frequently accessed images while safely freeing memory when the system requires it.

Can I apply image processing like resizing when loading images in SwiftUI?

You can apply optional image processing, such as resizing or generating thumbnails, directly within the CachedAsyncImage view. This allows you to process images during the loading pipeline before they are cached and displayed.

What is the best way to prevent duplicate downloads when loading the same image URL concurrently?

Request deduplication for image loading coalesces concurrent requests for the same URL into a single download. This prevents duplicate network traffic when multiple SwiftUI views attempt to load the identical remote image simultaneously.