We want to add a <hash>.state.json to conda’s cache, to replace the current “prepend three fields to the beginning of a 200MB json” format. Enables the cached repodata.json to be identical to upstream. <hash> would be the same as the previous cache since a few programs expect this. It would look like this. mtime is an addition - check that the mtime of <hash>.json matches the one inside <hash>.state.json to detect older clients. The file may contain arbitrary data to support incremental repodata e.g.
We will have the problem of incremental/non-incremental cache clients overwriting each other. When you switch to using the jlap file to download deltas from the last complete repodata.json, the etag / mod will have to come from the jlap file (since no new request was made for the full json, and we will want to replace the unmodified repodata.json with a patched version). A client that doesn’t expect the state file, and expects _mod and _etag to be in-line, will also think the cache is outdated and download repodata.json again. These clients could be run in “offline - don’t re-download repodata.json” mode to avoid this.
I assume that the problem will not be noticeable if most users type conda install less frequently than the remote repodata.json updates, since they would have had to download a fresh one either way.