[typo] Abstemious Cache Sweeping

Piers Cawley pdcawley at bofh.org.uk
Sun Dec 4 12:09:16 EST 2005


I've just posted a patch (Ticket #575 on the trac) which aims to move
us further along the road to a cache system that doesn't have to flush
the entire cache every time anything gets modified or added. Articles
now get 'touched' every time a comment is added or deleted, which
means that they get to sweep their cache, which is good.

So, I'm about to start to add better tracking of cached pages, and I
want to make sure that I've got my flushing rules straight in my head,
so I'm brain dumping here. Here's the rules I've worked out so far:

Action                                   Pages to flush
------                                   --------------

An article is created                    Uncategorized index pages

                                         This month's archive page

                                         Category indexes for the
                                         categories in which the
                                         article appears.

                                         If the article has any
                                         categories, and the category
                                         sidebar is enabled, flush the
                                         entire cache.

An article's content is modified         The article's permalink

                                         Any index/archive/category
                                         pages on which it appears

An article's category list changes       The article's old category
                                         index pages

                                         The new category index pages

                                         Every page, if categories
                                         sidebar enabled

An article gets a new comment or         The article's permalink
has a comment removed
                                         Any index pages the article
                                         appears on (comment count has
                                         changed)

A article comment is modified            The article's permalink

A new trackback/trackback removed        The article's permalink

                                         Any index pages the article
                                         appears on

Category created/deleted                 Category's index pages if new
                                         category. 

                                         Every page, if category
                                         sidebar enabled

There's also issues with the tag cloud needing to be regenerated for
every new article with tags. I'm half tempted to have article creation
simply zap the entire cache and be done with it and just aim for
better cache manipulation when new comments and trackbacks arrive. 

So, have I missed anything?

Also, this is based on the azure theme's behaviour, but I'm going
to try and avoid too much in the way of hard wiring. I'm also ignoring
the implications of changing various other things in the admin
interface, but the general way to deal with them is simply to zap the
whole cache.

-- 
Piers Cawley <pdcawley at bofh.org.uk>
http://www.bofh.org.uk/


More information about the Typo-list mailing list