All Questions
Llm Gateway Cost And Caching medium

A product-support bot uses a semantic cache with a 30-day TTL. After the pricing page changed, the bot kept quoting old prices for days because cached answers were still being served. What is the best fix?

  1. A Disable the semantic cache, since any cached LLM answer can go stale and so cached answers are never safe to reuse.
  2. B Tie each entry to its source documents' versions and invalidate on change, with shorter TTLs for volatile topics.
  3. C Raise the similarity threshold so only near-exact repeats hit the cache, which keeps stale answers from being returned.
  4. D Add 'always use the latest pricing' to the system prompt so the model overrides any outdated cached answer it sees.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions