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.
کارهایی که یادگیرنده بعد از این درس میتواند انجام دهد
- 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
۱ · بخوان
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.
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.
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.
HTTP exchanges stand alone, session identifiers carry application state, and caching rules control stored responses.
Original instructional content authored for os-taxonomy.
۲ · ببین
به انگلیسیدور از صفحهنمایش
جایگاه این موضوع
اول اینها را یاد بگیر
پیوندهای اختیاری
این موضوع راه اینها را باز میکند
۸ سؤال پشت این درس منتظرند، هر کدام با پاسخ توضیحدادهشده. هر پاسخ آسمان را پر میکند: ستارهها هنگام یادگیری روشن میشوند و وقتی زمان برگشتن است کمرنگ میشوند.
شروع یادگیری این موضوع