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 <cp368...@ohio.edu> wrote:
> 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 behind this page.
>
> The only problem is that the data on this page is somewhat dynamic.
> Whenever the user changes some data, the cache needs to be canceled
> and the page needs to be re-rendered. I can very easiely connect a
> signal or something to the user changing the data, but I'm having
> trouble figuring out how to expiring the view cache.
>
> I tried reverse()-ing the URL, and then feeding that into
> cache.delete(), but that didn't work. The docs really don't say how to
> expire per-view cache's other than just waiting for the expiration
> time to pass.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to