question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nuget.Server: Add read-through cache, fetching from other feeds (first-time) and caching locally

See original GitHub issue

From @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).

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:closed
  • Created 7 years ago
  • Reactions:19
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
maartenbacommented, Aug 24, 2020

Recommending BaGet for this scenario.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NuGet Server With Caching
So I want to auto-mirror repos and cache them. So far I have a few options: MyGet, which is a cloud-only offering (so...
Read more >
Managing the global packages, cache, and temp folders
In this article. Viewing folder locations; Clearing local folders; Troubleshooting errors. Whenever you install, update, or restore a package, ...
Read more >
Tips for creating and consuming NuGet packages locally
Clear the NuGet caches; Clear built project files (bin/obj files); Versioning locally; Define your local feed; Using Make to easy publish ...
Read more >
Creating NuGet Packages the easy way with .NET Standard in C
NuGet packages have become so easy to create, we will actually spend ... feed using Azure DevOps: setup 19:39 - Creating a NuGet...
Read more >
Hosting your own NuGet Server and Feed for build artifacts ...
This lets you index packages from an upstream source. You can use read-through caching to: Speed up your builds if restores from nuget.org...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found