テーマ: http
-
HTTP-Statuscodes richtig verwenden: die erste Verzweigung des Clients
Clients, Caches und Agenten entscheiden allein am Statuscode über Wiederholen, Neuladen oder Aufgeben: 201/204 für Erfolg mit und ohne Körper, 401 gegen 403 für fehlende Anmeldung gegen fehlende Berechtigung, 409/412/428 für Konflikte und Vorbedingungen, 429 und 503 mit Retry-After für «später». Ein 200 mit Fehlerobjekt täuscht alle.
-
Honor Retry-After as a lower bound
Schedule retries from either form of Retry-After while preserving the task deadline and avoiding premature repeated requests.
-
Backing off as a client: Retry-After, RateLimit headers and per-host budgets
How an agent should react to 429 and 503 responses and to advisory rate-limit headers: honour Retry-After exactly, otherwise back off exponentially with jitter, read the RateLimit and RateLimit-Policy fields where a server sends them to pace ahead of the limit, keep a budget per host and per key, and never retry a non-idempotent write without an idempotency key.
-
レスポンス圧縮:行う場所と除外すべきもの
テキストのレスポンス(HTML、JSON、Markdown)はプロキシかアプリケーションで圧縮し、圧縮済みの内容とストリーミング内容は除外する。エンコーディングが違っても ETag が正しく表現を示すようにし、Vary: Accept-Encoding を設定する。
-
Verteiltes Tracing in Umrissen: Spans, Eltern-Kennungen und W3C Trace Context
Ein Trace ist ein Baum aus Spans, jeder mit Trace-Kennung, eigener Span-Kennung, Eltern-Span-Kennung, Zeitstempeln, Attributen und Status; der W3C-Header traceparent trägt Trace-Kennung, Eltern-Kennung und ein Sampled-Flag über Prozessgrenzen, und ein Dienst, der beide Header nur weiterreicht, hält Traces trotzdem zusammen.
-
Custom 404 pages and soft 404s: serve the error page with the error status
A custom 404 page helps users only if it is served with status 404; a not-found page served with 200 is a soft 404 that crawlers keep fetching and search engines exclude. nginx's error_page can rewrite the status (error_page 404 =200 ...), which is exactly how soft 404s are created by accident; keep the status, make the page useful, and check with curl -I.
-
同一オリジンポリシー:オリジンの定義と隔離する対象
オリジンは URL のスキーム、ホスト、ポートからなる。スクリプトは同一オリジンの文書、ストレージ、応答を読み書きできる。別オリジンからの読み取りは既定で拒否されるが、フォーム送信などの書き込みや、画像・スクリプトの埋め込みは通常許可される。CORS は読み取り制限を緩めるが、CSRF 対策は引き続き必要である。
-
Using fetch with timeouts and AbortController
A fetch promise rejects only on network failure, not on HTTP error status, and it has no timeout by itself. Pass an AbortSignal combined from AbortSignal.timeout and a caller's controller, check response.ok, and tell TimeoutError, AbortError, network errors and HTTP errors apart in the catch.
-
Idempotente Operationen und sichere Wiederholungen entwerfen
Eine Operation ist idempotent, wenn ihre mehrfache Ausführung dieselbe Wirkung hat wie eine einzelne; RFC 9110 legt das für HTTP-Methoden fest, und ein Idempotency-Key-Header überträgt die Eigenschaft auf POST. Schlüssel samt Fingerabdruck und Ergebnis speichern, Konflikte mit 409 und 422 melden, Schlüssel nach dokumentierter Frist löschen.
-
Server-Sent Events と WebSocket の比較
Server-Sent Events は通常の HTTP でサーバーからクライアントへテキストイベントを配信し、自動再接続と最終イベントIDを扱う。WebSocket は独自のプロトコルでバイナリにも対応する双方向チャネルを提供する。一方向の更新には SSE、クライアントが頻繁に送信する場合には WebSocket を選ぶ。
-
Calling the TypeSafe API from an agent: request shape, errors, retries and version pinning
The documented contract an agent needs to call Jev without a chat layer: POST /v1/systemone with a Bearer key, a state, a model name and a map of typed questions; answers keyed like the questions plus a usage block; 401, 422, 429 and 529 with exponential backoff; aliases that move and versioned IDs that do not; SDK defaults for retries and the agent skill for coding agents.
-
Link ヘッダーとリンク関係型
RFC 8288 は、任意の HTTP レスポンスが Link ヘッダーで型付きリンクを伝える方法を定義する。形式は <target>; rel="relation" で、anchor、hreflang、type、title、media を追加できる。関係名は IANA 登録名(next、prev、canonical、alternate、describedby、preload)または独自拡張用の絶対 URI を使う。HTML 以外の応答から関連リソースを示し、103 Early Hints で先行取得を促す仕組みである。
-
Web Push basics: subscriptions, VAPID keys and the push service
A browser subscribes with its vendor's push service and hands the page an endpoint plus keys; the application server POSTs encrypted messages to that endpoint with a TTL header and a VAPID JWT (ES256, aud = push service origin, exp at most 24 hours) whose public key was passed to PushManager.subscribe as applicationServerKey. A 201 means accepted, not delivered.
-
Sitemaps und kanonische Adressen: ein Inhalt, eine Adresse
Jeder Inhalt sollte genau eine kanonische HTTPS-Adresse haben, die auf der Seite selbst erklärt wird; Zwillinge wie Markdown- oder JSON-Fassungen verweisen per Link-Header darauf, Parameter ohne Inhaltswirkung erzeugen keine neuen Adressen, und die Sitemap listet nur kanonische Adressen mit wahren Änderungsdaten.
-
HEAD と OPTIONS:何を回答し、クライアントは何に使うか
HEAD は本文のない GET であり、ステータスとヘッダーは同じだが、Content-Length と Vary は省略できる。キャッシュ可能で、リンク、サイズ、鮮度の確認に使う。OPTIONS はリソースまたはサーバー全体(OPTIONS *)の通信オプションを問い合わせ、通常は Allow を返す。キャッシュ不可で、Access-Control-Request-Method を伴う CORS プリフライトにも使う。
-
URL shortener walk-through: key generation, redirect status and abuse controls
A design walk-through for a URL shortener: random base62 keys with collision retry, a redirect path that touches one cache and one store, 302 rather than 301 when targets must stay revocable and countable, creation-side abuse checks, and a list of what not to build first.
-
Collapsing redirect chains to single hops raises the share of crawler requests that end in a 200 on a large site
Hypothesis: on a site with tens of thousands of URLs and accumulated redirects, rewriting every chain so that each old URL answers with one redirect to its final target measurably increases the share of search-crawler requests that reach a 200 page within a fixed daily request volume, because crawlers spend requests on each hop; a proposed before-and-after test on server logs.
-
JSON Web Tokens: what can go wrong and RFC 8725's answers
JWTs are signed claims, not encrypted secrets; validate the algorithm against an allowlist, verify issuer, audience and expiry, keep lifetimes short, never accept 'none', and remember that a stateless token cannot be revoked without a server-side list.
-
Bulk endpoints and partial failure reporting
A bulk endpoint either succeeds or fails as a whole or reports per-item outcomes; a single 200 cannot express partial success, so choose one behaviour per endpoint, index failures by position, cap batch size, and apply authorisation and rate limits per item.
-
HTTP ステータスコードを意図して選ぶ
クライアントが最初に処理を分岐させるのはステータスコードです。成功には 200/201/204、未変更には 304、不正な入力には 400/422、認証情報と権限の区別には 401/403、不在には 404、競合や前提条件には 409/412/428、後で再試行する場合には 429/503 を使います。
機械可読: JSON