Open loic-sharma opened 5 years ago
You could gzip compress pdbs and store them. If users come in with Accept-Encoding: gz
, serve the file raw, else de-/recompress and serve it.
gz
@LordMike Oh now you're just trying to be clever :-)
We could do something for nupkgs too, but note that not all NuGet clients support gzip. Gzip was introduced in v3.4.0 of the registration resource. Edit: nuget.org gzips JSON responses, not the nupkgs themselves.
Additonal option, add caching to the unpacked files. The few files actually requested are stored in ready-to-consume form, those that aren't are permanently placed in archives.
Does a client request files from CDN's directly, or are they redirected to it from the Nuget services?
Right now, I'm leaning towards gzipping over storing snupkgs. Storing snupks introduces complexity since we need to store metadata in the database.
Does a client request files from CDN's directly, or are they redirected to it from the Nuget services?
You can do both. nuget.org services content directly from CDN, Azure DevOps uses redirection.
note that not all NuGet clients support gzip
It isn't the NuGet client who's requesting the symbols but Visual Studio doing it.
@dotMorten Sorry, my comment wasn't clear. I meant that we could gzip nupkgs as well.
Wouldn't gain you much. Assuming the zip file is already compressed with Deflate, which Gzip also uses :)
You could recompress the nupkg on ingestion, ensuring that it actually is compressed and that it's compressed for storage (high compression).
Doing that could also remove extranous artifacts in the nupkg - imagine if somebody embedded Eicar as a random data file in their nupkg :P. I'm unsure how Nupkg signing works, so this may or may not work.
A agree that would just be double-compression. Not much point. And please don't modify the nuget packages - then I wouldn't know what package I'm testing, of it the repacking caused some issues.
You guys are right. I'm being silly, don't mind me 😋
@dotMorten do you need the package to be identical to the one you uploaded?
I can get the argument that if the rewriting missed a crucial file, it would be bad, but then all files in a nupkg should be specced out, so no files should exist beyond those defined. Right?
Allow customers that generate large amounts of PDBs to store these in compressed snupkg form. These symbols should be extracted when requested, on the fly. See: https://twitter.com/dotMorten/status/1070402374714281984
Follow up to: https://github.com/loic-sharma/BaGet/issues/130