if (HttpContext.Current.Items["blogName"] != null)
return HttpContext.Current.Items["blogName"].ToString();
else
// parse the blogName
Friday, December 12, 2008
Cache with HttpContext.Current.Items
This is a often overlooked yet very powerful cache option. In my BlogEngine multiple user project, multiple components of the page need to resolve blogName/ID, user roles etc. Since each time same user may hit different blog and this user will have different role for each blog, this is a ever-changing value. This per-request cache is a perfect solution.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment