# Is structured output compatible with automatic prefix caching?

**URL:** <https://discuss.vllm.ai/t/is-structured-output-compatible-with-automatic-prefix-caching/456>\
**Category:** Structured Outputs\
**Created:** [April 14, 2025, 6:50pm UTC](https://discuss.vllm.ai/t/is-structured-output-compatible-with-automatic-prefix-caching/456 "2025-04-14T18:50:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![g-eoj](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.vllm.ai/g-eoj/32/214_2.png) [@g-eoj](https://discuss.vllm.ai/u/g-eoj)\
**Post date:** [April 14, 2025, 6:50pm UTC](https://discuss.vllm.ai/t/is-structured-output-compatible-with-automatic-prefix-caching/456/1 "2025-04-14T18:50:35Z")

</div>

Imagine a scenario where there the prompt tokens are always the same but the `extra_body={"guided_regex":` argument can potentially change with a new request.

---

<div class="post-metadata">

**Author:** ![robertshaw](https://avatars.discourse-cdn.com/v4/letter/r/f475e1/32.png) [@robertshaw](https://discuss.vllm.ai/u/robertshaw)\
**Post date:** [April 14, 2025, 6:56pm UTC](https://discuss.vllm.ai/t/is-structured-output-compatible-with-automatic-prefix-caching/456/2 "2025-04-14T18:56:53Z")

</div>

Prefix caching just makes prompt processing faster. It has no impact on which tokens are generated.

Therefore it is compatible with structured generation, which only impacts the generation phase
