#22086: Building of template nodelist inside cache blocks
--------------------------------------+------------------------------------
     Reporter:  HenrikOssipoff        |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Template system       |                  Version:  1.6
     Severity:  Normal                |               Resolution:
     Keywords:  template, cache       |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by jaap3):

 I did some investigating and I don't think this is possible. `CacheNode`
 can only determine if something is in the cache at render time (it needs
 the context to look up `vary_on`). The "inner" node list is built at parse
 time by `do_cache`.

 Even if moving the cache lookup to `do_cache` was possible I would advise
 against it. It could cause (performance) issues by making the parser do
 cache lookup, way ahead of rendering.

 In your specific case I would look into what your custom tags `__init__`'s
 are doing and, if possible, to defer as much as possible to `render`.

--
Ticket URL: <https://code.djangoproject.com/ticket/22086#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/072.383e16d6dad0b4cf9859d1100e1e708c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to