ASP.net - Query-String Caching (VaryByParam)

In what situations should we use Query-Strings (VaryByParam) to achieve caching in ASP.NET?

Can someone give an example of a real situation in the case of a web application?

+3
source share
2 answers
Products.aspx?productID=12345

Obviously, you do not want the Product.aspx output cache to have data for the first product requested.

More details

Products.aspx?productID=12345, , 12345 . Products.aspx?productID=54321, , products.aspx , 12345. . VaryByParam .

+4

:

URL-:

http://www.myshop.com/Catalog/ViewAllProducts.aspx

http://www.myshop.com/Catalog/ViewAllProducts.aspx?PageNum=123&PageSize=50

http://www.myshop.com/Catalog/ViewProduct.aspx?ProductID=12345

URL - . , URL - , . (PageNum) (PageSize) - , , , , :

http://www.myshop.com/Catalog/ViewAllProducts.aspx?PageNum=123&PageSize=50

URL- . , , ( : , ..), .

URL - ( ) . ( - ). "ProductID" ( ) . , , , .

+2

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


All Articles