Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 14th, 2010, 04:14 PM
Registered User
 
Join Date: Apr 2010
Posts: 7
Thanks: 3
Thanked 0 Times in 0 Posts
Default Caching – please help, I’m completelly lost

hi

I’m looking at the way Marco implemented caching, and some of the implementation decisions the guy made simply don’t make sense to me, and besides feeling really dumb I’m also afraid that perhaps I’m missing the big picture. So I would really appreciate if someone could help me with my questions:



1) UpdatePost() method caches the following items:

Code:
BizObject.PurgeCacheItems("forums_unapprovedposts");
         BizObject.PurgeCacheItems("forums_threads");
         BizObject.PurgeCacheItems("forums_threadcount");
         BizObject.PurgeCacheItems("forums_thread_" + id.ToString());
         BizObject.PurgeCacheItems("forums_post_" + id.ToString());


a) Shouldn’t we first check whether the updated post is unapproved and only then then purge "forums_unapprovedposts" entry from the cache?
b) Wouldn’t purging "forums_threads" make sense only if the updated post was also a main post? So why don’t we first check if it is indeed a main post and then purge "forums_threads" entries?
c) I don’t see any point in purging "forums_threadcount", since we didn’t create a new thread?

2)
InsertPost() method purges:

Code:
if (approved)
         {
            BizObject.PurgeCacheItems("forums_threads");
            BizObject.PurgeCacheItems("forums_thread_" + parentPostID.ToString());            
            BizObject.PurgeCacheItems("forums_threadcount");
         }
         else
            BizObject.PurgeCacheItems("forums_unapprovedposts");
a) Again, doesn’t purging "forums_threads" and “forums_threadcount” only make sense if inserted post is also a main post?

3)
DeletePost() method purges entries:
Code:
BizObject.PurgeCacheItems("forums_unapprovedposts");
         BizObject.PurgeCacheItems("forums_threads");
         BizObject.PurgeCacheItems("forums_threadcount");
         BizObject.PurgeCacheItems("forums_thread_" + id.ToString());
         BizObject.PurgeCacheItems("forums_post_" + id.ToString());
a) But shouldn’t we first check whether deleted post is also unapproved, since by checking this, we may not need to also purge "forums_threads", "forums_threadcount”, "forums_thread_" + id.ToString()" entries, which would save us from quite a few trips to a database?!


4)
CloseThread() method only purges “forums_thread_" + threadPostID.ToString()" and “forums_post_" + threadPostID.ToString()".

a)But shouldn’t it also purge “forums_threads” and “forums_threadcount”?

5) Also, won’t MoveThread() cause non-main posts ( belonging to the thread we moved ) to contain invalid data, since their Post.ForumID property won’t return correct result?

6) Why doesn’t GetPostCountByThread() method also cache the resulting value?


I would really appreciate some help
 
Old April 26th, 2010, 03:17 PM
Registered User
 
Join Date: Apr 2010
Posts: 7
Thanks: 3
Thanked 0 Times in 0 Posts
Default

i realize this little protest will probably be ignored or not even noticed, but I'll moan anyway

Not trying to be provocative mr. Lee Dumond, but since you did reply to threads made after I this one, it appears you didn’t reply to my thread because you don’t know the answers to my question. It’s my thread, so I can’t be 100% objective, but caching and how to correctly implement it in a web application is one of most important aspects of any web application, so if you’re so inclined to help others with BeerProject related questions, why not also help with caching, especially if the Marko’s implementation appears to be imperfect?
If you don’t want to be bothered with more challenging threads, why not make a sticky about it, so we wouldn’t get our hopes up and wait perhaps weeks in hopes that mr. Lee will grace us with an answer( which one does if they invest so much time and energy into a website project )?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Caching stu9820 ASP.NET 3.5 Basics 0 June 20th, 2008 03:20 PM
caching jezywrap ASP.NET 2.0 Professional 0 February 27th, 2007 05:00 PM
Caching Amateur BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 February 9th, 2007 02:50 PM
caching? freaknfreak HTML Code Clinic 1 January 24th, 2006 12:10 PM
Caching bmains ASP.NET 1.x and 2.0 Application Design 4 February 27th, 2004 09:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.