Opened 2 years ago

Closed 2 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

Description

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 2 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 2 years ago by russellm

  • Resolution set to wontfix
  • Status changed from new to closed

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