Re: Expiring view caches

2010-02-12 Thread pjrhar...@gmail.com
The other thing you may want to consider is whether you need to cache the entire page or not. When users change some data, if it doesn't change everything you could use template fragment caching, and just delete the relevant bits when data is changed. Otherwise you could use lower level caching in

Re: Expiring view caches

2010-02-11 Thread HARRY POTTRER
just a quick note to anyone out there who finds this thread with the same problem as me: in that snippet, you need to change this line: if cache.has_key(key): to this: if key and cache.has_key(key): in order for it to work. It seems that registering accounts on django- snippets is broken, so p

Re: Expiring view caches

2010-02-11 Thread HARRY POTTRER
Oh I see, the key is an entire request object. Thanks, that worked! On Feb 11, 4:22 pm, David Zhou wrote: > Check out this snippet: > > http://www.djangosnippets.org/snippets/936/ > > Some what old though (2008), so it might need updating to work properly. > > -- dz > > On Thu, Feb 11, 2010 at 4:

Re: Expiring view caches

2010-02-11 Thread David Zhou
Check out this snippet: http://www.djangosnippets.org/snippets/936/ Some what old though (2008), so it might need updating to work properly. -- dz On Thu, Feb 11, 2010 at 4:18 PM, HARRY POTTRER wrote: > Is there any way to manually expire per-view caches? > > I have a view that executes betw

Expiring view caches

2010-02-11 Thread HARRY POTTRER
Is there any way to manually expire per-view caches? I have a view that executes between 100 and 200 database queries to render the page. The page basically renders a stats page for each user on my site. It only takes a few hundred milliseconds, but none the less I want some kind of cache sitting