@@ -141,3 +141,21 @@ uv determines the cache directory according to, in order:
141141It is important for performance for the cache directory to be located on the same file system as the
142142Python environment uv is operating on. Otherwise, uv will not be able to link files from the cache
143143into the environment and will instead need to fallback to slow copy operations.
144+
145+
146+ ## Cache versioning
147+
148+ The uv cache is composed of a number of buckets (e.g., a bucket for wheels, a bucket for source
149+ distributions, a bucket for Git repositories, and so on). Each bucket is versioned, such that if a
150+ release contains a breaking change to the cache format, uv will not attempt to read from or write to
151+ an incompatible cache bucket.
152+
153+ Within a cache version, changes are guaranteed to be forwards-compatible, but _ not_
154+ backwards-compatible. For example, uv 0.6.0 can read cache entries written by uv 0.5.0, but uv 0.5.0
155+ may not be able to read cache entries written by uv 0.6.0. As a result, it's safe to share a cache
156+ directory across multiple uv versions, as long as those versions are strictly increasing over time,
157+ as is common in production and development environments.
158+
159+ If you intend to use multiple uv versions on an ongoing basis, we recommend using separate caches
160+ for each version, as (e.g.) a cache populated by uv 0.6.0 may not be usable by uv 0.5.0, despite the
161+ cache _ versions_ remaining unchanged between the releases.
0 commit comments