GUIDE
Prompt compression vs prompt caching
Last updated 2026-11-15
Both techniques lower the cost of a prompt, but they work differently and they combine well.
Prompt compression
Compression removes tokens the model does not need: filler words, repeated instructions, stale history and the noisy parts of logs. You send fewer tokens, so you pay less and leave more room in the context window.
The risk is cutting something important. Good compression protects the question, code and data, and only trims low-value text.
Prompt caching
Caching lets the provider reuse a prompt prefix it has seen recently. Cached input tokens are billed at a lower rate, but they still count, and caching only helps when the start of the prompt stays identical between requests.
How to shorten a prompt without losing meaning
- Remove filler (“could you please kindly”, “I was wondering if”).
- State each rule once.
- Replace pasted logs with the relevant lines plus the error.
- Keep code, file paths, names and numbers exactly as they are.
- Compare the answer to the original and the shortened prompt on a few real tasks.
Automatic prompt compression for coding tools
VacuumPrompts is a free, automatic prompt optimizer for Windows. It compresses Copilot, Claude Code, Codex and ChatGPT requests on your PC using rules plus a small local model with a time budget of about 3 seconds, and keeps your code blocks untouched. Prompt Review shows the before and after side by side.
Frequently asked questions
Should I use prompt compression or prompt caching?
Both. Compression reduces how many tokens you send; caching makes the stable part cheaper. Compressing the changing parts and keeping the prefix stable gets the benefit of both.
Is there a free prompt compressor?
Yes. VacuumPrompts compresses prompts automatically for free on Windows, with no copy and paste.
Download VacuumPrompts free for Windows