Re: portal site Architecture

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



What does your VaryByCustom code look like? I'll create a test here
over the weekend..

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 23 Jun 2005 15:28:02 -0700, getdotnet
<getdotnet@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>I am now trying to cache the user control based on VaryByCustom. I have
>overriden the GetVaryByCustomString in the Global .asax file
>
>But the problem is that the Function GetVaryByCustomString is being called
>only after the control has been initialized. I am doing the rendering in the
>Load event of the user control. But the load event is being called much
>before the GetVaryByCustomString function. So it does not pick up output from
>cache.
>
>The control is placed in a master page and the outputcache is declared like
>this
><%@OutputCache Duration="1800" VaryByParam="none" VaryByCustom="UserId" %>
>
>What am I doing wrong??
>
>
>
>"Scott Allen" wrote:
>
>> Personally, I'd tend to favor caching of a user control - you'll cache
>> not just the data but also the rendering so it's the best bang for the
>> buck.
>>
>> It probably won't be possible to use VaryByParam, it would be a bad
>> idea to identify the user based on a query string param, but you could
>> use VaryByCustom [1]and cache based on the user's name. The example
>> below caches based on browser type, but you could change the code..
>>
>>
>> [1]
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/aspnet-cachingtechniquesbestpract.asp
>>
>> --
>> Scott
>> http://www.OdeToCode.com/blogs/scott/
>>
>> On Tue, 21 Jun 2005 12:38:13 -0700, getdotnet
>> <getdotnet@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>>
>> >Thanks Scott.
>> >Could you (or someone) please answer my other question as well
>> >
>> >The header aslo contains user information along with teh division of teh
>> >person. Now this information has to be capyured from a database. What is the
>> >best way to cache this info?
>> >Should i contain the user and division info in a user control and cache it
>> >based on some parameter using teh outputByParam in outputcache (parameter
>> >being the user name?)
>> >Or is there any better way to do it?
>> >
>> >Thanks!
>> >
>>
>>

.



Relevant Pages

  • Re: portal site Architecture
    ... I am now trying to cache the user control based on VaryByCustom. ... But the problem is that the Function GetVaryByCustomString is being called ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Output cache
    ... Do they use a Label control, or some other control that the parent ... you can use VaryByCustom to cache by almost any key ... >Hi scott, ... >User control has different functionality, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Caching DataGrid Page
    ... It looks like the "VaryByCustom" option can do ... Any text that represents custom output caching requirements. ... attribute is given a value of browser, the cache is varied by browser ... ASP.NET server controls declared in the user control. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to force a reload of cached user control?
    ... By using a cache, you are leaving a lot of work to ... If you cannot recreate the control, then what happens when the cache ... The user control contains a HyperLink control named ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Who can give me a explanation?
    ... To cache multiple versions of a user control declaratively by using the ... Create a user control that posts back. ... VaryByControl attributes. ... The profile identification ...
    (microsoft.public.cert.exam.mcad)