Re: portal site Architecture
- From: Scott Allen <scott@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 24 Jun 2005 09:09:40 -0400
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!
>> >
>>
>>
.
- Follow-Ups:
- Re: portal site Architecture
- From: getdotnet
- Re: portal site Architecture
- References:
- portal site Architecture
- From: getdotnet
- Re: portal site Architecture
- From: Scott Allen
- Re: portal site Architecture
- From: getdotnet
- Re: portal site Architecture
- From: Scott Allen
- Re: portal site Architecture
- From: getdotnet
- portal site Architecture
- Prev by Date: RE: Q: why am I getting this
- Next by Date: Re: What's the simplest way to do URL rewriting?
- Previous by thread: Re: portal site Architecture
- Next by thread: Re: portal site Architecture
- Index(es):
Relevant Pages
|