A page with several objects visited more than once. For each object and each visit, the browser decides: serve it from the cache, revalidate it with a conditional GET, or download it again. Follow the decision tree and the messages it produces.
A browser cache simulator for a web page with its HTML base file and several objects, visited several times. The server sets the freshness of each object with Cache-Control (max-age=N, no-cache, no-store or no information) and every 200 response carries Last-Modified. On each visit, t seconds after the previous one and with some objects changed on the server, the browser decides object by object following the decision tree: if it is not cached, normal GET and 200 OK; if it is cached and fresh (age below max-age), it is served from the cache without any message; if it is cached but stale (or no-cache), conditional GET with If-Modified-Since, answered with 304 Not Modified without a body if it has not changed or 200 OK with the new object if it has. The visualization shows the path followed in the tree, the browser–server sequence diagram of the visit, the cache table before and after (version, age, freshness, decision) and a summary of messages and downloaded bytes. The student edits the page and the visits, plays the decision step by step, uses prepared examples, practises with random exercises and exports the diagram as SVG or PNG.
Concepts: web caching, browser cache, freshness, Cache-Control, max-age, no-cache, no-store, conditional GET, If-Modified-Since, Last-Modified, 304 Not Modified, revalidation.
Formulas:
fresh ⇔ age < max-age, with age = now − time the copy was received304 ⇔ conditional GET and Last-Modified of the copy = Last-Modified on the serverNetwork Architecture I, Session 2.3 · Enrique de la Hoz, University of Alcalá · License CC BY-SA 4.0 · Source and catalogue on GitHub · DOI 10.5281/zenodo.23285664