In which situations should we use Query-Strings (VaryByParam) to achieve Caching in ASP.NET?
Can anyone give an example of a real-life situation in case of an web-application?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Obviously you don’t want the output cache of Products.aspx to have the data for the first product that got requested.
In detail
If I hit
Products.aspx?productID=12345the page will be processed for me, look up the info for product 12345, and cache the results. Then you hitProducts.aspx?productID=54321, the page will not be processed for you but products.aspx will be retrieved from the output cache and you’ll see the info for 12345. Not good. VaryByParam resolves this.