Nuget.Server: Add read-through cache, fetching from other feeds (first-time) and caching locally
See original GitHub issueFrom @NickCraver on April 24, 2016 12:43
Nuget.Server does most of what we need to build Stack Overflow locally for our packages (mostly produced by TeamCity today). However, it could be much more useful with read-through caching. Here’s the flow:
- Client asks for a specific package version
- Nuget.Server has it locally
- Package returned
- Nuget.Server doesn’t have it
- If no cache-miss feeds configured, 404 (same as today)
- If cache-miss feeds configured (new)
- Nuget.Server fetches (in order, same as nuget.exe) from a configured feed list. (new)
- If found, Nuget.Server caches it in the local folder and returns it to the client.
- If not found, 404 (same as today).
- Nuget.Server fetches (in order, same as nuget.exe) from a configured feed list. (new)
- Nuget.Server has it locally
It’s really far simpler to show this in code with a prototype. Here’s a fully functional example I made using nuget.org as the cache-miss source: https://github.com/NickCraver/NuGet.Server/commit/452af26550607c56825c38022d464b1422629509
I’d love to upstream a fleshed out version of this feature this because I think it’d be useful to many others: it’d save the world a little bit of bandwidth, dependency depth, and some build failures when the internet goes boom.
A few questions to start with:
- Is there a fundamental problem with the approach?
- Our uses are simple so maybe we’re blind here.
- What’s the simplest config mechanism we could use for multiple feed sources?
appSettings
is a bit limited here, but we could make it work.
- Will this be confusing, by nature only working on authenticated feeds (as a cache-miss source)?
- IMO, auth delegation is confusing, complex, and not worth it here.
Copied from original issue: NuGet/Home#2650
Issue Analytics
- State:
- Created 7 years ago
- Reactions:19
- Comments:13 (5 by maintainers)
Top GitHub Comments
Recommending BaGet for this scenario.
@NickCraver http://stackoverflow.com/a/34959690