12.7 · Image loading pipelines: download, decode, downsample, cache

Images are the largest part of most apps’ traffic and memory. A good pipeline treats them as four separate costs: bytes, decoding, pixels in memory and repeated requests.

Mental model. A file’s size on disk means little. What matters is how many pixels you hold decoded, and how often you fetch or decode the same one.

The pipeline

Each stage and what it costs.

  1. How do you design an image loading pipeline: decoding, downsampling, caching and de-duplication? 12.7.1 · L5
    Think of the pipeline as stages, each with its own cost and cache. 1) Fetch the bytes with URLSession: honour HTTP caching, cancel when the cell leaves the…

More in Networking