All Questions
Llm Gateway Cost And Caching easy

A support chatbot builds each prompt in this order: the current timestamp, the user's question, then a 3,000-token system prompt and tool definitions. Prompt caching is enabled, but the cache hit rate is near zero. What is the best fix?

  1. A Increase the cache TTL so that cached prefixes survive longer between incoming requests.
  2. B Move the tool definitions into a separate request so they get cached independently.
  3. C Put the system prompt and tools first, then the timestamp and question.
  4. D Switch to semantic caching so that prompts with similar wording can reuse the cached system prompt.

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

Get the app

Related questions