Opened 6 years ago

Closed 6 years ago

#19372 closed New feature (wontfix)

{% include %} should accept a caching parameter

Reported by: italo maia Owned by: nobody
Component: Template system Version: 1.4
Severity: Normal Keywords: templatetags, include
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Include would do nicely with a cache parameter. Something like this:

{% include "template.html" 10 %} -> caches for 10 seconds

Change History (2)

comment:1 Changed 6 years ago by Aymeric Augustin

While this save a few keystrokes, it's less explicit than the current version:

{% cache 10 included-template %}{% include "template.html" %}{% endcache %}

I don't think the gain in concision is worth the loss in clarity.

comment:2 Changed 6 years ago by Russell Keith-Magee

Resolution: wontfix
Status: newclosed

I agree with Aymeric. Mixing a template structure call (include) with caching infrastructure seems like a bad idea to me.

Note: See TracTickets for help on using tickets.
Back to Top