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 September 3rd, 2007, 04:58 PM
Friend of Wrox
 
Join Date: Mar 2006
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default delete cache files quickly

Hello!

I notice that cache files like "articles" "articles_articles" "articles_article_121" don't update if we change directly a database!

Sometimes I need to do a change in a stored procedure and I like to clear all the TBH cache files...

How can it be done quickly?
Thanks!

 
Old September 4th, 2007, 03:49 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

Max,

As you know, in the BLL InsertArticle(), you have the ability to do something like the following:

BizObject.PurgeCacheItems("articles_article");

this will delete everything from cache that has a *wildcard* key that begins "articles_article". Basically, what you really need to do is stick closely to the framework model and have methods in the BLL/DAL that you use to perform the *amendments* mentioned via the stored procedure. otherwise, you'll really end up having a spaghetti type of code where tracking down bugs will be 'hidden' from you due to some things happening in code and others 'invisibly' inside stored procedures called directly from UI etc, etc..

Just my 'purist' thoughts on the matter :D

[edit] of course you could just create a 'super-slim' method in the BLL that could be called from your 'code-behind'. I do this all the time to pick up attributes (perform comparisons) etc, so there would be no problem in doing the same thing to effect purely a clearence of the cache. i.e. in the \BLL\Articles\Article.cs class, you could add the following method:

        public static void ClearArticleCache()
        {
            BizObject.PurgeCacheItems("articles");
        }

this would be called inside your page.aspx (where required - i.e. just after running your stored proc) as:

        Article.ClearArticleCache();

It'd work fine, and if it were 'well' commented would prolly be OK

jimi

http://www.originaltalent.com
 
Old September 4th, 2007, 06:46 AM
Friend of Wrox
 
Join Date: Mar 2006
Posts: 310
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Jimibt!

Quote:
quote:Originally posted by jimibt
Basically, what you really need to do is stick closely to the framework model and have methods in the BLL/DAL that you use to perform the *amendments* mentioned via the stored procedure.
Unless you have to change a stored procedure!

That was the case! I don't make changes in DB directly, but I added a column to categories table and changed various procedures...
In that cases I could use your Purge function!

By the way, i'll make a admin page for purge all objects that i Want!

Articles, Categories, Posts, etc!

Thanks very much

 
Old September 4th, 2007, 09:07 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 488
Thanks: 2
Thanked 11 Times in 10 Posts
Default

max - no worries, should work fine

jimi

http://www.originaltalent.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
How Can I Delete Cookie files. MICZ VB How-To 4 August 18th, 2007 04:56 AM
How can i delete specified webpage cache? ramo9941 C# 3 April 21st, 2007 09:21 PM
delete files in the server miguel.ossa Classic ASP Basics 1 September 5th, 2005 12:15 PM
Delete Files qazi_nomi Classic ASP Basics 7 October 18th, 2004 06:55 PM
How Can I Delete Cookie files. MICZ Pro VB 6 2 August 13th, 2004 10:44 AM





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