Lessons learned
- Multipart $batch queries suck, they still only execute server-side in parallel. I wrote a full multipart implementation only to throw it away
- Fiddler and some proxies only supports HTTP/1.1 and can give false positives about how many connections are actually being made. Use wireshark to be sure when testing HTTP/2 and HTTP/3
- `[Dictionary].keys`` is not a stable target at all for task iteration, best to maintain a separate list
- PSGetv3 doesn’t follow the nuget server v3 spec of optional params (stuff marked optional will cause psgetv3 to throw if not present)
- Initially the logic would fetch the main page and resolve dependencies by fetching individual versions. Turns out its only barely slower to return all versions of a module in single call, probably because the PSGallery server-side filtering doesnt cache, so we instead fetch all versions of a module in a reduced way from our Cloudflare worker and use that as a cache.
- Parallel dependency lookups (lots of Az dependencies require Az.Account) resulted in lots of duplicate calls for Az.Account. Since all task calls bottleneck through our main async loop logic, we can safely inspect existing dependency calls just before execution to determine if the existing call will satisfy it, and then add the context on to the existing object to prevent the duplicate calls.
Development
Run .\build.ps1 which will install all prerequisites (using ModuleFast!) and compile/test the package. After running it once, you can simply use Invoke-Build to start a new build. The module will be output into the Build Directory by default.