-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The versions disk cache and http cache headers #6538
Comments
It looks like you found the correct way to disable caching when calling the restore APIs. At this time caching is a client policy, changing this to use the server policy instead would likely cause performance problems for most users. //cc @joelverhagen |
Hey @lbargaoanu, could you provide a bit more context on your issue?
As @emgarten said, in the NuGet ecosystem caching is designed to be a client policy. Since many of our customers work in a multi-feed environment, having caching as a client policy means better consistency and better performance when sources wouldn't otherwise properly implement cache headers. Also, the |
Yes, we have multiple feeds too and I did notice they send different headers. But we do have control on the feed that gets updated and causes the problem. Thanks for the tips. I guess I'm missing more granular control. I just want to be able the restore the latest versions, otherwise the cache is great :) We'll look more closely to see what MaxAge will do for us. |
Closing as #3389 seems the gist of it. |
While using RestoreCommand and repeatedly publishing new versions of a package, we've noticed that new versions are not found and the restore fails. We always request the latest published version. This seems to be because the results of the queries for package versions are cached on the disk. But the responses for those requests send HTTP cache headers that say the results should not be cached. I think the on disk cache should respect those cache headers. We get the same behavior in VS with PackageReferences. Related to #5445. But deleting nuget.cache doesn't help, only clearing the cache. I guess the workaround is to set SourceCacheContext.MaxAge to DateTime.UtcNow.
NuGet.Commmands version 4.5.
The text was updated successfully, but these errors were encountered: