What does the `want-mass-query` store setting do, exactly?

Nix stores have a want-mass-query option that is included in the nix-cache-info response (e.g. https://cache.nixos.org/nix-cache-info).

What does this option actually do? I am wondering whether I should enable it or not on our AWS S3 binary cache.

So just looked through the Nix repo a bit, and the only thing close to an explanation is Allow a binary cache to declare that it doesn't support "nix-env -qas" · NixOS/nix@66a3ac6 · GitHub and a test for the current functionality of that value: https://github.com/NixOS/nix/blob/1ed245a60672c123c1348a63061fb4d64fb95212/tests/functional/binary-cache.sh#L29-L61

So from that, it seems like it’s something you’d set in your binary cache if you don’t mind a massive amount of HEAD requests that shows which dependencies of some derivation exist in the cache in a faster way.
It’s probably a non-issue with S3, and I’m not sure if this will continue to be used at all in future (if/when) nix-env is deprecated.
I couldn’t easily test it on my machine since nix-env doesn’t work anymore once you’ve used nix profile, but feel free to experiment and report your insights.

1 Like