diff --git a/django/template/loaders/cached.py b/django/template/loaders/cached.py
index 788dad9..991580e 100644
a
|
b
|
class Loader(BaseLoader):
|
34 | 34 | raise TemplateDoesNotExist(name) |
35 | 35 | |
36 | 36 | def load_template(self, template_name, template_dirs=None): |
37 | | if template_name not in self.template_cache: |
| 37 | # Use hash(..) to avoid saving potentially large template_dirs values |
| 38 | key = hash((template_name, template_dirs)) |
| 39 | |
| 40 | if key not in self.template_cache: |
38 | 41 | template, origin = self.find_template(template_name, template_dirs) |
39 | 42 | if not hasattr(template, 'render'): |
40 | 43 | try: |
… |
… |
class Loader(BaseLoader):
|
45 | 48 | # we were asked to load. This allows for correct identification (later) |
46 | 49 | # of the actual template that does not exist. |
47 | 50 | return template, origin |
48 | | self.template_cache[template_name] = template |
49 | | return self.template_cache[template_name], None |
| 51 | self.template_cache[key] = template |
| 52 | return self.template_cache[key], None |
50 | 53 | |
51 | 54 | def reset(self): |
52 | 55 | "Empty the template cache." |