What is the life-time of server-side caching list?

What is the life-time of server-side caching list?

Old forum URL: forums.lhotka.net/forums/t/12236.aspx


sash_kr posted on Monday, November 25, 2013

I'm trying to understand csla 3-tier mechanism.

 

Let's say I have cached NameValueList<int, string>

I would like to use it in ReadOnlyBase Fetch operation:

void DataPortal_Fetch(SomeDto dto)
{
    this.Id = dto.Id;
    this.TypeId = dto.TypeId;
    this.TypeName = TypeList.GetList().GetTypeName(dto.TypeId);
    ...
}

 where, TypeList is  my cached NameValueList<int, string>.

As we know in 3-tier architecture "DataPortal_Fetch" method will be executed on server side. So TypeList.GetList() will be cached on server side. But what is the life-time of this cached list? Only during time of "DataPortal_Fetch" execution or client application execution or maybe something else?

What is  scope of this list: "client application", "all client applications",  or maybe something else?

nbsp;

JonnyBee replied on Monday, November 25, 2013

Default implementation is that the list is cached until the

IE: The default cache duration is linked to process uptime.

You could also change implementation to use AppFabric or other Cache systems that allow you to specify ejection criterias (typically a timespan or absolute time).

CslaContrib has baseclasses and project that show how to use AppFabric for caching. 

sash_kr replied on Monday, November 25, 2013

So,

"server-side cached list" is global to all client applications and it's stay cached until application pool is recycled or IIS/server is restarted.

"IE: The default cache duration is linked to process uptime.": Process uptime - is  IIS process uptime?

Do I understand correctly?

 

 

JonnyBee replied on Monday, November 25, 2013

Yes. That is the default behavior. 

If you look inside the code you will find that the lst is cached in a static member field. 

sash_kr replied on Monday, November 25, 2013

Thank you very much Smile

Copyright (c) Marimer LLC