Ordinance answers cached in Azure Managed Redis become stale when the prompt or model version changes. What should cache keys include?
Select an answer to reveal the explanation.
Short Explanation
Bake the recipe version into the label—when the prompt or model changes, the Redis key changes too, so old ordinance answers don’t get served like yesterday’s soup.
Full Explanation
Ordinance answers cached in Azure Managed Redis must invalidate when the prompt template or model version changes; otherwise residents receive answers generated under outdated instructions. Including model and prompt version segments in cache keys ensures a version bump naturally misses old entries and repopulates with answers from the new prompt or model. That key design is the standard way to couple generative configuration changes to cache identity.
Using only the wall-clock second of the first cache write with no model identity does not track generative configuration and can both over-fragment and under-invalidate. A single global key named answers for every ordinance topic and version causes collisions and stale cross-topic reuse. Embedding resident Social Security numbers as cache key segments introduces sensitive PII into keys and logs and is inappropriate.
Exam caveat: cache-key versioning is about identity of inputs that affect output (model, prompt, and usually the question fingerprint)—not about using personal identifiers. Operational check: deploy a prompt version increment, confirm old Redis keys are no longer hit for new requests, verify new keys include the version segments, and sample cached ordinance answers for alignment with the updated prompt.