Solice UI
Back to the curriculum

Chapter 6 · Performance & Tooling

Caching and delivery

A cache saves a reusable response so later visits do not need the same transfer and server work. Delivery networks place copies of public assets near readers to reduce distance and load on the origin.

Beginner · Lesson 3 of 6 in this chapter

Caching needs an update strategy

Long-lived caching is safe for files whose URL changes when their content changes. HTML often uses shorter caching because it points to the newest versioned assets and must update promptly.

A CDN serves from nearby locations

A content delivery network can cache images, scripts, and other public responses at edge locations. It does not remove the need for correct headers, secure origins, or a plan for invalidating changed content.

Shipping a new stylesheet

  1. The build creates a stylesheet filename containing a content hash.
  2. Browsers cache that immutable file for a long time.
  3. A new release creates a different filename, so the updated HTML points to the new style without guessing whether an old cache is stale.
  • Cache reusable work deliberately.
  • Versioned asset URLs make long caching safer.
  • A CDN improves delivery but does not decide update correctness for you.