---
title: "The Web as a Protocol: Requests, State and Caching"
description: "HTTP uses independent request and response exchanges. Cookies or tokens let an application identify a session across requests, while caching headers tell browsers and shared caches when a response may"
canonical: https://lightmysky.com/learn/computing/the-web-as-a-protocol-requests-state-and-caching-mt_MDiW4Vt0bo
source: https://lightmysky.com/learn/computing/the-web-as-a-protocol-requests-state-and-caching-mt_MDiW4Vt0bo.md
retrieved: 2026-11-12
---

> **Agent view.** This is the Markdown twin of the page, for tools and assistants.
> When to use this site, and the call that answers each job: https://lightmysky.com/agent-instructions.md
> API description (OpenAPI 3.1): https://lightmysky.com/openapi.json · Authentication: https://lightmysky.com/auth.md
> Pricing: https://lightmysky.com/pricing.md · Catalog: https://lightmysky.com/llms.txt · Full catalog: https://lightmysky.com/llms-full.txt
> Every machine-readable file on this domain: https://lightmysky.com/.well-known/ai-catalog.json
> Ask for Markdown with `Accept: text/markdown`, a `.md` address, or `?mode=agent`.

# The Web as a Protocol: Requests, State and Caching

HTTP uses independent request and response exchanges. Cookies or tokens let an application identify a session across requests, while caching headers tell browsers and shared caches when a response may be reused.

Subject: Computing · Area: Networks & Security · Ages 19 to 21
Page: https://lightmysky.com/learn/computing/the-web-as-a-protocol-requests-state-and-caching-mt_MDiW4Vt0bo

## Ready when they can

- Read a request and response pair and name the parts that carry meaning
- Explain how a stateless protocol supports a logged-in session
- Say what a caching header changes for a browser and for an intermediate cache

## Lesson: A protocol that remembers nothing

HTTP uses requests and responses. A browser sends a request with a method, a target path, headers, and sometimes a body. The server replies with a status, headers, and sometimes a body. For example, the request GET /news carries the header Host: example.com, and the response 200 OK carries Content-Type: text/html with the page as its body.

HTTP treats each request as an independent exchange. The server cannot rely on the protocol to remember an earlier request. An application can carry state by sending a session identifier in a cookie or token with later requests.

**Example.** Logging in can set a cookie that contains a session identifier. The browser sends that cookie with a later request. The server uses the identifier to find the session and recognise the account without HTTP remembering the earlier exchange.

*(drawing: The cookie carries the session identifier back with later requests.)*

Caching rules control reuse. A response can carry a Cache-Control header. The directive max-age=3600 means a stored copy stays fresh for 3600 seconds. The directive private lets the user's own browser store the response but forbids a shared cache, such as a proxy serving many users, from storing it. The directive no-store forbids every cache from storing it. A browser cache keeps copies for one user, while a shared cache sits between many users and the server.

**Recap.** HTTP exchanges stand alone, session identifiers carry application state, and caching rules control stored responses.

*Original instructional content authored for os-taxonomy.*

## Practice

8 questions on this page, each with its working shown.

## Needs first

- [Routing: How a Path Is Learned](https://lightmysky.com/learn/computing/routing-how-a-path-is-learned-mt_gyqPDrV6Uo)

## Optional connections

- [How a Web Page Reaches Your Screen](https://lightmysky.com/learn/computing/how-a-web-page-reaches-your-screen-mt_8JveAW2Mg7)

## Opens up

- [TLS: Putting the Pieces Together](https://lightmysky.com/learn/computing/tls-putting-the-pieces-together-mt_JzIwi-BYG0)
- [Clocks, Ordering and Happens-Before](https://lightmysky.com/learn/computing/clocks-ordering-and-happens-before-mt_ratia1eb_2)
