On 12/13/05, oron <[EMAIL PROTECTED]> wrote: > coming from ROR where it's easy to cache partials (parts of templates) > I couldn't find a way to cache just parts of my template easily without > going back to the cache low level API. > > What's the suggested strategy for caching for example the home page > which will be hit lots of times, in case where I use sessions and need > to display the "hello {{ user.name }}" somewhere etc.
You could write a custom {% cache %} template tag that would cache everything between it and {% endcache %} for a certain number of seconds: {% cache '500' %} This will be cached for 500 seconds. {% endcache %} If you write it and submit a patch, we'd definitely consider adding this to the Django distribution. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org