Opened 7 years ago

Closed 7 years ago

#6201 closed (fixed)

Improved cache tag to allow timeout to be a template variable

Reported by: zz <zodizz@…> Owned by:
Component: Template system Version: master
Severity: Keywords: template caching
Cc: stefan@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

from ticket:1065

Somehow the idea of having cache time spread all over the place seems a bit cluttering especially if you use the tag more frequently throughout templates. Having the timeout in a single variable is helpful.

The patch allows the timeout to be a template variable and also adds some extra tests.

Attachments (2)

cache_tag.diff (4.3 KB) - added by zz <zodizz@…> 7 years ago.
Improved tag to accept time as variable
cache_tag2.diff (4.8 KB) - added by edrik 7 years ago.
Updated the patch and added a line to the docs

Download all attachments as: .zip

Change History (7)

Changed 7 years ago by zz <zodizz@…>

Improved tag to accept time as variable

comment:1 Changed 7 years ago by mattmcc

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 7 years ago by SmileyChris

  • Owner changed from nobody to SmileyChris
  • Status changed from new to assigned
  • Triage Stage changed from Design decision needed to Ready for checkin

I don't think a design decision is necessary. This is useful functionality and it's backwards compatible.

comment:3 Changed 7 years ago by SmileyChris

  • Owner SmileyChris deleted
  • Status changed from assigned to new

comment:4 Changed 7 years ago by anonymous

  • Cc stefan@… added

I really think this is necessary, I was thinking of doing this if I hadn't found this ticket.
Please check it in ;)

Changed 7 years ago by edrik

Updated the patch and added a line to the docs

comment:5 Changed 7 years ago by adrian

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

(In [7754]) Fixed #6201 -- Improved the {% cache %} template tag to allow the timeout to be a template variable. Inspired by the patch by zz and edrik

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