Opened 9 years ago

Closed 8 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@…> 9 years ago.
Improved tag to accept time as variable
cache_tag2.diff (4.8 KB) - added by Fredrik Sjöblom 8 years ago.
Updated the patch and added a line to the docs

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by zz <zodizz@…>

Attachment: cache_tag.diff added

Improved tag to accept time as variable

comment:1 Changed 9 years ago by Matt McClanahan

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 9 years ago by Chris Beaven

Owner: changed from nobody to Chris Beaven
Status: newassigned
Triage Stage: Design decision neededReady for checkin

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

comment:3 Changed 9 years ago by Chris Beaven

Owner: Chris Beaven deleted
Status: assignednew

comment:4 Changed 8 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 8 years ago by Fredrik Sjöblom

Attachment: cache_tag2.diff added

Updated the patch and added a line to the docs

comment:5 Changed 8 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(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