﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28737	Clarify {% cache %} tag's handling of arguments	Tom Aratyn	nobody	"The Django docs describe the use of the `cache` template tag:

> It’s perfectly fine to specify more than one argument to identify the fragment. Simply pass as many arguments to {% cache %} as you need.

However the code will only use a single value (https://github.com/django/django/blob/7cc155a04ce9579de3cdca59db9a4de11dc5eab9/django/templatetags/cache.py#L90):

{{{
    return CacheNode(vary_on = [var.resolve(context) for var in self.vary_on]
cache_key = make_template_fragment_key(self.fragment_name, vary_on)
        nodelist, parser.compile_filter(tokens[1]),
        tokens[2],  # fragment_name can't be a variable.
        [parser.compile_filter(t) for t in tokens[3:]],
        cache_name,
    )
}}}

What's more the example code in the docs uses an variable as part of the fragment name, but the code explicitly says that that doesn't work.

I'd prefer for the solution to be to bring the code inline with the docs, but at least the docs need updating."	Cleanup/optimization	closed	Documentation	2.0	Normal	fixed			Accepted	1	0	0	0	0	0
