skip to content

In a mobile art-museum app on weak signal, what should an artwork's detail page show while its large image loads?

level: middleimportance: should knowfreq 42%

answer

  1. the visitor has already seen it
  2. reuse what is already decoded
  3. a frame of the final shape
  4. coarse passes that sharpen
  5. always end in a state

basics

~20 s

Show the grid's already-decoded thumbnail at once, in a frame of the final aspect ratio, then swap in the large image. A progressive JPEG can sharpen in passes on slow links; a failure shows retry, never an endless spinner.

solid answer

~50 s

The visitor tapped a painting they were just looking at, so its grid thumbnail is almost certainly in the memory cache: show it immediately, scaled into a frame that already has the final aspect ratio, so nothing jumps. Start the large request at the highest priority and crossfade when its decode completes. With nothing cached - the page was opened from a shared link, say - show a neutral placeholder such as the artwork's dominant colour, if the API supplies one. On weak signal a large image can take seconds; if the server sends progressive JPEGs and the decoder supports drawing partial data, the page shows coarse full-frame passes that sharpen, rather than sitting blank, at the cost of repeated decode work. And the page must always settle: the full image, or the thumbnail with a visible retry - never a spinner with no end.

go deeper

for a junior

Remember never to leave a blank or endlessly spinning frame: show something at once, and show a retry when loading fails.

for a middle

Explain reusing the grid's decoded thumbnail as the preview, sizing the frame from the artwork's aspect ratio, and how a progressive JPEG differs from a baseline one while loading.

for a senior

Judge when progressive decoding is worth its extra decode work, how failure and automatic retry behave on weak signal, and why partial bytes must never be cached as complete.

for a principal

Set one loading-state rule for every image surface, covering preview, placeholder, progress and failure, so screens behave alike instead of each inventing its own spinner.

## What the visitor should see, in order A detail page for one artwork has a handful of honest states, and the design job is to move through them without a blank screen or a jump: 1. **Instant preview.** The best available image already on the phone, shown in the first frame. 2. **Loading the real image.** The preview stays visible; a subtle progress cue is optional, a full-screen spinner is not needed. 3. **Sharpening.** Where progressive decoding is available, coarse passes of the large image replace the preview and sharpen as bytes arrive. 4. **Done.** The large image, decoded to the page's pixel size, crossfades in. 5. **Failed.** The preview stays, with a clear retry, and the page retries on its own when connectivity returns. ## Reusing what is already on the phone The visitor reached the detail page by tapping a cell in the grid, so the pipeline has just decoded that artwork's thumbnail, perhaps 500 x 375 pixels. It sits in the memory cache under the same URL at a smaller size. Asking the pipeline for **any cached decode of this URL** - not only the exact size - lets the page draw it immediately, scaled up into the hero frame. - **It is free.** No download and no decode, just drawing pixels that are already in memory. - **It gives continuity.** The visitor sees the painting they tapped grow into place rather than a grey box. - **It is honestly blurry.** Upscaled, it looks soft, which signals that more detail is coming. - **It must not be cached as the large image.** The preview is drawn, not stored under the large key, or the next visit would show the blurry copy as final. The hero frame should have the painting's aspect ratio from the first frame, taken from the artwork's metadata, so the text below does not move when the image arrives. ## Placeholders when nothing is cached When the page is opened without passing through the grid - from a shared link, or after the app was ended and restored - the memory cache is empty. The options: | Placeholder | Cost | Effect | |---|---|---| | **Neutral background** | Nothing | Honest, but plain | | **Dominant colour** | A few bytes in the artwork's metadata | Hints at the painting's tone | | **Tiny embedded preview** | Under a few kilobytes in the API response | A recognisable blur of the painting | | **Spinner alone** | Nothing | Reads as stalled on weak signal; avoid as the only cue | Which of these the API sends, and in what form, is the server's variant decision; the client's part is to draw whatever it has, in the right frame, before the real image arrives. ## Progressive and low-resolution-first display On a weak connection, a large image might take several seconds to arrive. Two techniques fill that time: - **Low-resolution first.** Fetch and show a small version, then the large one. Here the grid thumbnail already plays that role, so no extra request is needed. - **Progressive encoding.** A progressive JPEG stores the image as several passes over the whole frame, coarse first. A decoder that can draw partial data shows a blurry full picture early and sharpens it as more bytes arrive. A baseline JPEG drawn while loading fills in from the top instead, leaving the rest blank. - **It costs decode work.** Each intermediate pass is another decode and another draw, so it pays off for large hero images on slow links, not for grid thumbnails that arrive in a moment. - **It depends on both ends.** The server must encode progressively, and the decoder in use must support drawing incomplete data; if either is missing, the page falls back to the preview-then-swap sequence. ## Failure and slow states - **Never strand the visitor.** A spinner with no timeout on a gallery's weak signal looks the same as a frozen app. - **Keep the preview on failure.** The blurry painting with a retry is better than an error box where the painting was. - **Retry when it can succeed.** Retry automatically when connectivity returns, and on the visitor's tap, with backoff rather than a tight loop. - **Never store partial bytes as a finished image.** A download cut off halfway must not be written to the disk cache as complete, or every later visit decodes a broken file.

  • Why not show a spinner until the full image has downloaded?
    On weak signal that can mean several seconds of an empty frame for a painting the visitor was looking at a moment ago. The thumbnail is already decoded in memory and costs nothing to draw, so showing it keeps continuity and signals that the page is working. A spinner alone reads as stalled, and if the request hangs with no timeout it never resolves.
  • When is progressive decoding not worth it?
    When images are small or the network is fast: a grid thumbnail arrives in one go, so extra passes are invisible work. Each pass costs a decode and a draw, so on a page with many images it adds CPU and battery for no visible gain. It also needs the server to encode progressively and a decoder that draws partial data; without both, the preview-then-swap sequence is the plan.
  • The large image fails halfway through on weak signal; what should the visitor see?
    The thumbnail preview, still in place, with a visible retry. The partial bytes are discarded rather than cached as a finished file. The page retries on its own when connectivity returns and on a tap, with backoff, so a dead zone in the gallery does not turn into a loop of failed downloads.

  • Show an empty frame with a spinner until the full image has downloaded.
  • The grid thumbnail cannot be a placeholder because it is the wrong size.
  • A progressive JPEG needs less memory and decode work than a baseline one.
  • Write a partially downloaded image to the disk cache so it can be shown later.
  • A failed image load can leave the spinner running until the user leaves.