I am trying to cache user controls, and on some pages I want to cache individual objects. There are several ways to implement caching, and my head breaks over it.
Now I see the caching options:
You have the PartialCaching option, which is configured to cache the control for 30 minutes, and after that it is cleared ... You have the ByParam variable to identify the page by its querystring parameters ... or other change parameters
But I just can't find a suitable way to add caching to the control and be able to clear the caching programmatically when I update one of the objects used in the control from the backend.
You can make an HttpContext.Current.Cache.Insert () that accepts a key on which you can subsequently destroy the caching element by deleting ... This can save the objects in the cache, but you can use parameters like variableByParam?
My questions are burned to two:
- Is there a way to clear the caching of certain user controls from code? If so, can this be done according to different options?
- How will object caching respond to users or anonymous users with the Insert () function?
EDIT: I cache a few things ... And I'm really stunned when I choose to link to the cache. Can Cache.Insert vary in parameters?
The main problem is to copy the editing of things from the backend, which should trigger an event that restores or clears all caching elements that reference this object.
source share