Re: Patch for simple walk caching

Bill Mill <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
On Thu, 9 Dec 2004 10:44:53 -0600 (CST), will guaraldi
<[email protected]> wrote:
> On Thu, 9 Dec 2004, Bill Mill wrote:
> 
> 
> >
> > It's really simple to modify the caching to work only for those two
> > files. Put this in your config.py:
> >
> > py['cache_only'] = ['pyblosxom.cgi', 'root', 'index.rss'] # '' gets
> > changed to root
> >
> > and then change
> >
> > if config.get('cache_dir'):
> >
> > to
> >
> > p = http.get('PATH_INFO', '').lstrip('/') or 'root'
> > if config.get('cache_dir') and p in config.get('cache_only'):
> 
> Woah!  That's slick!

thanks...while I was looking at it a second time, this could become a
permanent change to the cache with one more slight little touch:

p = http.get('PATH_INFO', '').lstrip('/') or 'root'
if config.get('cache_dir') and p in config.get('cache_only', [p]):

With this change, if there's no cache_only in the config.py,
config.get will just return [p] and continue on its merry way.

Peace
Bill Mill
bill.mill at gmail.com


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.