On Sun, 2009-08-02 at 04:25 -0400, Nick Fishman wrote:
> I was wondering if it's possible to not specify the expiration time
> when using the {% cache %} tag to cache template fragments. With the
> low-level API, cache entries will expire after a timeout configured in
> CACHE_BACKEND. Is it possible to use the same default when caching
> template fragments?
> 
> In particular, I'd like to use model signals to invalidate cache
> entries. That way, entries won't be invalidated after an arbitrary
> time period, but rather when they're actually invalid. Nathaniel
> Whiteinge wrote on 2008-12-03 that the {% cache %} tag creates entries
> with keys "fragment_name:additional:arguments:seperated:by:colons", so
> this seems possible.

The "cache" template tag always requires a timeout (although the
docstring on the function in django.templatetags.cache.do_cache() lies
and suggests otherwise). It might not be too difficult to add support
for an optional timeout, although the error checking requires a lot of
care. So you might want to have a swing at adding this support and open
an enhancement ticket with a patch in Trac if you get that far.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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