Is output caching variable parameters in web forms, understand route parameters?

Does VaryByParams caching output in webforms route parameters? For example, if I have a route similar to "Content/{filename}/{more}", which I could do VaryByParams="filename"and would it return cached results based on the file name and ignore any values ​​in more?

+3
source share
1 answer

VaryByParam only works with the query string when the HTTP method is GET and parameters (i.e. values ​​in the form and query string) when the HTTP method is POST. If you do not use the query string for routing, I do not think that it will work.

Please see the @OutputCache documentation.

http://msdn.microsoft.com/en-us/library/hdxfb6cy.aspx

Maybe you can write your own caching with C # in the code behind the page instead of relying on @OutputCache.

+2
source

Source: https://habr.com/ru/post/1752635/


All Articles