Skip to content
tokz

Comparison

Prompt compression and prompt caching solve different problems.

Prompt caching reuses a provider's previously processed prefix. Prompt compression changes which context you send. A sound architecture measures both rather than treating one as a universal replacement.

Choose caching for stable repeated prefixes

Caching is a strong fit when a large prefix is reused, remains stable, and the provider offers favorable cache-read economics. It avoids reprocessing that exact prefix.

Choose compression for irrelevant or oversized context

Compression helps when tool output, logs, retrieved documents, or JSON contain material the current request does not need. Tokz selects source spans and can preserve structured bytes.

Use both carefully

Compressing a stable cached prefix can reduce cache hits. Keep stable instructions protected, compress changing data, and measure provider input, cache-read, cache-write, and Tokz costs.