Removing a Output Cache by Param.

Posted by vishalneeraj-24503 under ASP.NET category on | Points: 40 | Views : 341
We can attach a cache dependency to the response that is unique per query param ,then invalidate the dependency for the particular param as:-

//Add cache item dependency on response object  
string cache_key = "rec_cv.aspx?" + query_param;
Cache[cache_key] = new object();

//invalidate the dependency
string cacheKey = "rec_cv.aspx?" + query_param;

Comments or Responses

Login to post response