ETag って特に書式ないの?
RFC 2616 - Hypertext Transfer Protocol – HTTP/1.1
3.11 Entity Tags
Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the ETag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. The definition of how they are used and compared as cache validators is in section 13.3.3. An entity tag consists of an opaque quoted string, possibly prefixed by a weakness indicator.
weakness indicator と quote 以外はなんにも言ってない気がする。
実際例に挙がっている文字と例えば Apache の返す ETag 文字列とはまったく異なる。要は
リソースの変化が検出できる仕様になっていて " で囲まれていれば何を基準にどんな文字列を生成するのも自由
ってことかな?
あーなるほど。この解釈で合ってるみたい。
- Apache はデフォルトでは inode, mtime, size を - で結んだ文字列を返す
- core - Apache HTTP サーバ
- inode が絡むとスケールアウトさせられないので大規模なサービスでは inode は使わない設定にするらしい。
- core - Apache HTTP サーバ
- Rails は response body の md5 を返す
単純なファイルを返す場合以外は Rails 方式を採用するのがいい感じだ。
More
Recent Posts
- » Gemini Advancedでもうゲームが変わっていた
- » 今さらLLMのモデルの違いとプロンプトエンジニアリングについて
- » Bundler環境でIRBでもLSPでもドキュメントを利用する方法
- » Ruby 3.2と3.3のirb historyの扱いの違いと対処方法
- » Result型とRailway Oriented Programmingをめぐる旅
- » dry-operationのススメとエラー情報をViewまで持っていく方法の模索
- » aligach.netのRubyとViteをバージョンアップした
- » ViteRuby 3.7.0は起動方法のデフォルトがnpx経由になった
- » GmailからSpreadsheetとGoogle Driveへ書き出すGASライブラリを作った
- » 面倒くさがり屋のためのTypeScript環境