The Web as a Protocol: Requests, State and Caching · seed 1 · A4, ink-friendly. The answer key prints on its own page for grown-ups.
به انگلیسی

A protocol that remembers nothing

Computing · Networks & Security · ages 19-21
Name ______________________   Date ____________
  1. What does stateless mean for HTTP?

    • The server stores each earlier request forever
    • Each request stands alone unless state is sent with it
    • The browser can use HTTP without receiving any responses or status codes
  2. Which set lists meaningful parts of an HTTP request?

    • A screen size, pointer position, and cable type
    • A method, target, headers, and optional body
    • A response status, server rack, and plug shape
  3. What can caching headers decide?

    • The price of the server and the user's account
    • The colour of the page and the screen brightness
    • Whether a stored response may be reused and for how long
  4. A logo loads quickly on repeat visits, but the news text is fetched again. Why can that happen?

    • The logo's freshness rules allow longer reuse than the news response
    • The server has no remaining copy of the news text
    • Cookies prevent browsers from storing the logo response
  5. You log in, then open a second page and remain logged in. How can this work?

    • The server memorised every browser screen
    • The browser sent a session cookie with the new request
    • HTTP changed from independent exchanges to a stored conversation
  6. A cookie can let a stateless HTTP exchange support a logged-in session.

    Circle one:   True   False

  7. An account page arrives with Cache-Control: private, max-age=600. A shared cache may store it and serve it to the next visitor for 600 seconds.

    Circle one:   True   False

  8. A shop keeps each cart on its server, linked to a session cookie. A user clears cookies during shopping and the cart empties. What best explains this?

    • The session identifier was removed, so the server lost the cart link
    • The cache was cleared, so every stored page lost its layout
    • The browser changed HTTP from stateful to stateless
LightMySky · lightmysky.comW1-mt_MDiW4Vt0bo-s1

Answer key

For grown-ups. Fold this page away before handing over the rest.

A protocol that remembers nothing W1-mt_MDiW4Vt0bo-s1

  1. Each request stands alone unless state is sent with it · HTTP does not assume memory of earlier requests. An application must send a cookie, token, or other state when it needs continuity.
  2. A method, target, headers, and optional body · An HTTP request can carry a method, target, headers, and an optional body.
  3. Whether a stored response may be reused and for how long · Caching directives set reuse and freshness rules for browsers and shared caches.
  4. The logo's freshness rules allow longer reuse than the news response · Different response caching rules can give a stable logo a longer reuse period than changing news text.
  5. The browser sent a session cookie with the new request · The later request carries the session identifier, allowing the application to find the logged-in session.
  6. True · The browser sends the session identifier again, and the application uses it to recover session continuity.
  7. False · private lets only the user's own browser store the page. A shared cache must not store it, so it cannot serve the page to another visitor. max-age=600 only sets how long the browser's copy stays fresh.
  8. The session identifier was removed, so the server lost the cart link · The cookie carried the identifier that linked the request to the shopping session. Removing it can make the application create or find a different session.
Worksheet · LightMySky