Results 1 to 4 of 4

Thread: Caching User Controls : A dark art?

  1. #1

    Thread Starter
    Addicted Member billyblue's Avatar
    Join Date
    Dec 2008
    Location
    Belfast
    Posts
    203

    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

  2. #2
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  3. #3

    Thread Starter
    Addicted Member billyblue's Avatar
    Join Date
    Dec 2008
    Location
    Belfast
    Posts
    203

    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

  4. #4
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width