In Valid Logic

Endlessly expanding technology

Qgyen.ClearCommentCache

with 10 comments

Recently, I had an idea for a new CSModule that would make it so that comments to blog posts would show up immediately after being posted, instead of having to wait for the cache to be cleared.  As such, my new ClearCommentCache module was born.

This module does not prevent the caching of comments in any way.  It simply waits for a new comment or trackback to made, and after it is submitted, it will clear the current cache of modules, so that on the next request, it will go to the database and get a fresh list.

A few other little things it does includes:

  • Will only clear the cache when the comment passes spam filters
  • Will allow you to configure it to clear the cache across all posts, or only certain posts
  • Use a [ ClearCommentCache ] text part (no spaces around the [ ]) will cause the cache to be cleared on new comments for that particular post.  It will also strip the text part from the message so it doesn't show.

Yes, the module is being used on this post (though only this post, not across my whole site).

Download (Requires Community Server v2.1)

Written by krobertson

October 4th, 2006 at 7:17 pm

Posted in Archive

10 Responses to 'Qgyen.ClearCommentCache'

Subscribe to comments with RSS or TrackBack to 'Qgyen.ClearCommentCache'.

  1. More Qgyenification for dbvt.com!  Installed and working great!  Thanks for creating this CSModule, Ken.  

    Don’t forget that people are also going to have to change their Success Message, removing "it may not appear right away due to caching." :-)

    ken

    4 Oct 06 at 10:08pm

  2. Yeah, but that is more involved than dropping in a module and adding a module entry.  :)

    ken

    4 Oct 06 at 10:38pm

  3. Sounds great Ken. Can the same be done for blog posts?

    ken

    4 Oct 06 at 11:29pm

  4. Yeah, you could change the code to do that.

    ken

    5 Oct 06 at 12:01am

  5. Testing this sucker out.

    Good idea btw.

    ken

    5 Oct 06 at 5:04am

  6. Kinda sad that this change wasn’t made to the core though – this is a case where caching really gets in the way of the user having a good experience. Caches should be flushed by the app when the underlynig data is modified…oh well..

    ken

    5 Oct 06 at 6:30am

  7. A cache/memory overhaul is needed in CS, and will more than likely be coming with like 3.1.  If nothing else, I’ll just dive in and do it myself. :)

    ken

    5 Oct 06 at 10:45am

  8. Also when flushing the cache on posting a new post, will make Windows Live Writer work better on detecting style! :)

    I’d LOVE that feature in this plugin!

    ken

    6 Oct 06 at 3:06pm

  9. Does this work even with the forums? I noticed that posts to my forums take a while to appear.

    ken

    12 Oct 06 at 10:53am

  10. No, it is not for the forums, it is only for the blogs.

    ken

    12 Oct 06 at 1:03pm

Leave a Reply

Comments links could be nofollow free.