Output cache per User

后端 未结 2 1628
余生分开走
余生分开走 2020-12-03 06:08

Hi have quite a memory intensive dashboard which is different per user. How do I cache the response based on the current logged in userID which is not passed as a parameter

2条回答
  •  伪装坚强ぢ
    2020-12-03 06:39

    Modify your code a bit and add a hidden field in your form that has the userId hash, when you're POSTing.

    Or a better way is to use the VaryByCustom method, and vary based on a user cookie value.

    Here is a good reference:

    http://codebetter.com/darrellnorton/2004/05/04/asp-net-varybycustom-page-output-caching/

提交回复
热议问题