Skip to content
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

varyByParam="None" not work #55

Open
murilobom opened this issue Dec 19, 2016 · 5 comments
Open

varyByParam="None" not work #55

murilobom opened this issue Dec 19, 2016 · 5 comments

Comments

@murilobom
Copy link

When I add varyByParam = "None" in outputCacheProfiles the outputcache does not ignore the parameters that are added in the url, the redis cache stores another record.

@JonCole
Copy link
Contributor

JonCole commented Dec 19, 2016

I suspect this behavior is controlled outside of the output cache provider (e.g. by ASP.NET)- from what I remember, the interface it implements is pretty simple and the decision of what to cache and what not to cache is not made by this provider. I suggest you try this out with some other output cache providers and compare the behavior.

@Firegarden
Copy link

I am having the same issue - the varyByParam is not respected in asp.net mvc outputCacheProfiles from web.config. It always varies by param causing many copies to be put in cache.

@JonCole
Copy link
Contributor

JonCole commented Jan 12, 2018

@SiddharthChatrolaMs - can you please check with the ASP.NET team on this issue. As I mentioned above, I suspect this is not specific to this cache provider implementation, but we should confirm and have recommendations from the experts.

@Firegarden
Copy link

I just found that if you set the parameter on the [OutputCache] Attribute in the controller method then it works as expected. example you would write [OutputCache(VaryByParam ="none")] in the controller.

What does not work is if you try and just set this in the config file where you have a named output cache profile [OutputCache(CacheProfile = "MyCustomCacheProfile")]

I verified this works as expected if you set it in the code - only one cache item created in Redis

@mapalan
Copy link
Member

mapalan commented May 15, 2020

@murilobom, @Firegarden, is this still something you would like to see looked into? Apologies for the late response, the team has been quite busy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants