I think I didn't get the whole picture before; reading the docs and
source a bit more, it looks like you can't manually get/set/clear
(decorator) cached views. The view-level decorator basically
applies/restricts the middleware functionality to a specific view
instead of all views (or just excluding admin pages with the built-in
middleware).

What you probably want is the low-level cache API, and use it to store
the results of your long-running calculations. Since you're setting the
entry in the cache the key generation is up to you. So you wont' be
caching at the page or view level, just specific pieces of data that
are resource-intensive, and the view will run on every request.

It's probably not a huge ordeal to extend/rewrite the caching
middleware to respond to signals and let you cache page level and clear
it by sending signals on data updates, but I don't think anything like
this is available out of the box. But maybe it is somehow, I'm not too
familiar with all the innards and parts available... you can see how
Django generates its keys in django.utils.cache.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to