-
Notifications
You must be signed in to change notification settings - Fork 641
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
Fix for #498 - added OutputCache attribute #505
Conversation
Correct me if I'm wrong, but I think this fix will only apply to local installations of the NuGetGallery, because the main nuget.org site uses Windows Azure and the Nonetheless, for local installations it'll be perfectly OK to cache the response indefinitely as it's not possible to upload an updated package with the same version, like you said. |
@akoeplinger Thanks for the info. I'm definitely targeting this at local installations of NuGet Gallery rather than the nuget.org instance, although it still could be relevant there (if the storage ever changes). |
@matthewskelton Good point. I'll plan on using NuGet Gallery for one of my projects soon, so this will definitely improve the performance.
According to the MSDN, a value of Downstream however means
I think it's perfectly valid for the client to also cache the nupkg forever, because even if the format changes etc, the existing packages won't be updated anyway. Can you clarify why you think clients should not cache the package? |
@akoeplinger Hmm, well spotted; I missed the crucial "and the client" on that page. However, I don't think that the client should never cache the content, just that I'd have liked to restrict the cacheability changes I am pushing to avoid side-effects at the client-side. However, (having refreshed my memory on this!) HTTP 1.1 does not support "cache everywhere except the client", and well-implemented clients should handle the |
@matthewskelton You're right, caching on the server will be a waste of resources in this case as the proxy/client should cache it indefinitely. I just noticed another point that wasn't considered yet: download statistics. The |
@akoeplinger Interesting. I think this shows how - so far - the assumed deployment model for NuGet Gallery is that the ASP.NET application itself will front all the requests. I raised #499 to cover another scenario relating to Gallery sitting behind a caching proxy, so there is clearly some interesting work to be done in this area :) Do you want to raise a ticket to capture the |
I just filed an issue here: #506 |
@akoeplinger Thanks - looks good. |
You are correct; we currently haven't planned to move package downloads to a CDN or other cache. It's something we've talked about, but nothing more. The question, then, is whether we want to add downstream caching until we've better considered this. Moving to CDN gives a way to pull in the stats from the CDN and add it to our stats. But with downstream caching, the tick will never get sent. As you mention in #506, that might well be okay, and perhaps we need to consider changing how we track stats. Until the team has considered it though, I think we need to hold off on this change. I'll keep the PR up until we do. Thanks! |
I agree that downstream caching should only be enabled when the statistics problem is solved. |
Why don't we close the PR for now and re-open when we're ready to take these changes? Keeping it open just pollutes the queue. I'll do that and if you disagree, feel free to comment and re-open. :) |
As discussed over in #498, I've added the following:
We can cache the results 'permanently', but only at server/proxy intermediate layers (not at the client).