diff --git a/django/template/loaders/cached.py b/django/template/loaders/cached.py
index 4c25acd..864b54f 100644
a
|
b
|
class Loader(BaseLoader):
|
42 | 42 | # If template directories were specified, use a hash to differentiate |
43 | 43 | key = '-'.join([template_name, hashlib.sha1('|'.join(template_dirs)).hexdigest()]) |
44 | 44 | |
45 | | if key not in self.template_cache: |
| 45 | template_tuple = self.template_cache.get(key) |
| 46 | if template_tuple is None: |
46 | 47 | template, origin = self.find_template(template_name, template_dirs) |
47 | 48 | if not hasattr(template, 'render'): |
48 | 49 | try: |
… |
… |
class Loader(BaseLoader):
|
52 | 53 | # back off to returning the source and display name for the template |
53 | 54 | # we were asked to load. This allows for correct identification (later) |
54 | 55 | # of the actual template that does not exist. |
55 | | return template, origin |
56 | | self.template_cache[key] = template |
57 | | return self.template_cache[key], None |
| 56 | return template, origin |
| 57 | template_tuple = (template, origin) |
| 58 | self.template_cache[key] = template_tuple |
| 59 | return template_tuple |
58 | 60 | |
59 | 61 | def reset(self): |
60 | 62 | "Empty the template cache." |