Caching User Controls : A dark art?
Hello,
I have been working on a site recently that relies heavily on user controls.
With the site nearly complete we are now looking to improve efficiency with some caching.
I have been looking at a number of options. In some cases a simple varybyparam fits the bill. However some user controls don't suit this model for whatever reason.
This sent me down the line of PartialCaching where I vary the cache by property.
This seems to work a treat if I declare the property in my markup, ie <uc7:JustPublished ID="JustPublished1" runat="server" categoryid="101" />
however if the control sits on a page that has a number of variants and I set the property in the codebehind eg categoryid = 101 it does not vary the cache.
Anyone encounter anything similar or have any good suggestions?
Thanks for reading
BB
Re: Caching User Controls : A dark art?
Hello billyblue,
Did you ever find a solution to this?
I can't say that this is something that I have ever done, so I don't know the best way to guide you.
Sorry!
Gary
Re: Caching User Controls : A dark art?
Hi Gep,
Afraid not. I just ended up caching my data in the codebehind. I am assuming this is less efficient that caching the whole control but I couldn't find an example of this working unfortunately.
Thanks
Scott
Re: Caching User Controls : A dark art?
That is a shame :(
I am sure that there is a way, but I am not familiar with one.
Gary