HTTP-кеширование изнутри: ETag, Last-Modified и эвристика браузера

Как браузер принимает решение о кешировании? Что такое условный HTTP-запрос? Как возникает 304 Not Modified? Как устроен принудительный запрос ресурса, минуя кеш? Если эти вопросы для вас актуальны, прошу на огонёк. Изложение намеренно подробное: статья адресована и тем, кто только начинает путь в веб-разработке, и тем, кто просто хочет закрыть отдельные пробелы в понимании механизма кеширования. Скажем "нет" слепому копированию заголовков кеширования. Погружаемся

https://habr.com/ru/articles/1010594/

#сети #http #кеширование #кэширование #rfc9111 #starlette #uvicorn #httpсервер #браузеры #rfc9110

HTTP-кеширование изнутри: ETag, Last-Modified и эвристика браузера

Скажем "нет" слепому копированию заголовков кеширования. Введение Как браузер принимает решение о кешировании? Что такое условный HTTP-запрос? Как возникает 304 Not Modified? Как устроен...

Хабр
This is one of my favorite things, data model explainers! Makes me think of #rfc9110, which turned my head super fast. Instead of a technical document on http the protocol, a rfc on what the model of http is. datatracker.ietf.org/doc/html/rfc... Understanding not what is but what it means enables!

RE: https://bsky.app/profile/did:plc:nzrozayxq764zbgl4qtp5ald/post/3met5uiixb22h


RFC 9110: HTTP Semantics

chunked transfer decoding ✅

I had to split HTTP message handling from my HTTPd.py server into a separate module in order to replace urllib.request with an async version.

While testing I stumbled over forums.gentoo.org chunked transfer encoding and devided to integrate transfer decoding in the parsing method.

#python3 #asyncio #HTTP #rfc9110 #rfc9112

We cannot know the resource-in-itself, only its representations. Very Kantian!

https://www.rfc-editor.org/rfc/rfc9110.html#section-3.2
https://en.wikipedia.org/wiki/Thing-in-itself

#rfc9110

I might be splitting hairs about the semantics of #HTTP PUT, but there seems to be a slight contradiction in #rfc9110

On one hand, a GET after a PUT should return the exact representation that was set by the PUT.

On the other hand, a PUT "might also cause links to be added between the related resources" which seems to say that the representation might be enriched with extra links.