HTTP caching: Cache-Control, ETag and URLCache
The gist
The HTTP cache is configured by the server through response headers; the client only picks a policy. A URLSession with the .default configuration has a URLCache (memory + disk) that runs the cache logic itself: a fresh response is served with no network at all, a stale one is revalidated with a conditional request, to which the server replies 304 Not Modified with no body.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep