{
  "synthetic": true,
  "execution": "Teaching record only; no live integration tested",
  "slug": "language-negotiation-cache-key-proof",
  "group": "delivery-architecture",
  "title": [
    "A language response needs a matching cache identity",
    "语言协商响应，要有对应的缓存身份"
  ],
  "intro": [
    "A supplier may serve English and Chinese from one public endpoint using Accept-Language. If the cache key ignores that choice, one visitor can receive another language’s response. This is a representation-selection contract, separately from whether personalised pages may be stored.",
    "供应商可能在同一公开接口按Accept-Language返回中英文。若缓存键忽略选择，访客就可能得到另一语言的响应。这是内容版本选择问题，与私人页面能否存储分开验收。"
  ],
  "facts": [
    [
      "The Vary response header identifies request fields that influence a response for caching. A cache must support and apply the relevant variation; a header alone does not prove a CDN’s configuration.",
      "Vary响应头列出影响缓存响应的请求字段；缓存系统须支持并实际应用变化，一个响应头不能证明CDN配置。",
      "https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Vary"
    ]
  ],
  "example": [
    [
      [
        "GET/public-help; resolved locale=en",
        "Key includes path+resolved locale",
        "English stored under /public-help|en"
      ],
      [
        "GET/public-help，选定en",
        "键含路径及选定语言",
        "英文存在/public-help|en"
      ]
    ],
    [
      [
        "Same path; resolved locale=zh",
        "Key includes same dimensions",
        "Chinese stored separately at/public-help|zh"
      ],
      [
        "同路径，选定zh",
        "采用相同维度",
        "中文独立存在/public-help|zh"
      ]
    ],
    [
      [
        "Both responses use key/public-help",
        "Bodies have different approved language",
        "Collision: reject the cache contract"
      ],
      [
        "两响应均用/public-help为键",
        "正文批准语言不同",
        "发生碰撞，拒收缓存规则"
      ]
    ],
    [
      [
        "No supported language match",
        "Declared fallback=en",
        "Record fallback and matching key; do not invent a third locale"
      ],
      [
        "没有支持的语言匹配",
        "约定回退en",
        "记录回退及对应键，不制造第三种语言"
      ]
    ]
  ],
  "steps": [
    [
      "Decide whether URLs or negotiated request fields select language. For negotiated responses, document normalisation and fallback so equivalent headers do not create uncontrolled variants.",
      "先确定语言由URL还是请求字段选择；协商响应须约定归一化及回退，避免等价请求制造无限版本。"
    ],
    [
      "Prime the same endpoint in EN then ZH and reverse the sequence in an authorised test cache. Compare actual body language, response policy and repeat-visit bytes.",
      "在获准测试缓存按先英后中、先中后英两种顺序预热，比较实际语言、响应策略及重复访问字节。"
    ],
    [
      "Record the cache product and supported key dimensions. Treat missing configuration evidence as unknown, especially when an intermediary overrides origin headers.",
      "记录缓存产品和支持的键维度；缺配置证据保持未知，尤其是中间层覆盖源站响应头时。"
    ]
  ],
  "result": [
    "The first two rows cannot share a stored representation. The failure is visible even if every response returns200. The example uses normalised language tokens, not a recommendation to cache an unbounded raw header or to change established language URLs.",
    "前两行不能共用缓存版本，即使所有请求都返回200也会失败。本例使用归一化语言标记，并非建议缓存无限原始头或改变既有语言URL。"
  ],
  "accept": [
    "Require correct language in both warm-up orders and a proven supported cache key. Preserve the approved privacy policy independently.",
    "两种预热顺序均须语言正确、缓存键有支持证据；已批准隐私策略另行保持。"
  ],
  "limit": [
    "Synthetic public endpoint and cache identities; no cache purge, CDN change, private-data test or alteration of existing language routes.",
    "合成公开接口及缓存身份，不清缓存、不改CDN、不测私人数据，也不改变既有语言路由。"
  ],
  "oldLinks": []
}
