Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Sueetie List View Control Cache Management

The following is a new Sueetie Developer Resources Wiki Document on managing Sueetie List View Control Caching. In Gummy Bear up to the most recently released version of 1.1 I simply max-cached the list content and didn’t think much about it. Then a Sueetie User called me to task saying that not including List Cache Management of List Controls was "nonsense." Oookay. When I thought about it I decided I didn’t like the max-cache approach either, so I added Sueetie List View caching described here.

__________________

The Default State of List View Caching

Sueetie List View Controls display application data from anywhere on a Sueetie Community Site.  Each list is cached independently and by default is cached for 5 minutes. Here is a screenshot of List Views in action on the Sueetie.com home page.

Image

How to set List Caching

Because Sueetie is a website project, you can make changes directly to the List View control codebehind .cs files as shown below for the BlogListPost control by setting the “CacheMinutes” property.

Image

Sueetie list view controls are designed so you can set the cache on the .ASPX page with Intellisense as well.

Image

The SueetieCacheDuration Enumerator

There are two additional management options for Sueetie List View Controls: MaxDuration and NoCache, -1 and 0 respectively. You can specify these options in the List View control .cs codebehind as shown below.

Image

Clearing the Cache

The cache for all Sueetie List View controls can be flushed at any time by using the application's action class ClearCache() method. (SueetieBlogs.ClearBlogPostListCache(), SueetieForums.ClearForumTopicListCache(), etc.)  List view control cache keys use properties of the Sueetie ContentQuery object--applicationID, groupID, userID and IsRestricted. This is to support independent caching of multiple lists and list types across multiple applications. For instance, if both a Recent Blog Post list and a Blog posts by user were used, the ContentQuery object allows us to flush the cache of the designated blog post list only.

Here's an example of clearing a blog post list cache in BlogPostList.ascx.cs.

Image

Comments (0) | Post RSS RSS comment feed

Posted on 1/10/2010 7:53:16 PM by Dave Burke
Categories: Sueetie
Tags: No tags for this post

Related posts

Comments are closed

This site was built with the Sueetie .NET Open Source Community Framework. Learn more about Sueetie at Sueetie.com.