Skip to content

Commit 6f4a907

Browse files
committed
Take output mode into account when caching the template tag output.
1 parent 586d89c commit 6f4a907

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compressor/templatetags/compress.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,15 @@ def render(self, context):
4343
compressor = CssCompressor(content)
4444
if self.kind == 'js':
4545
compressor = JsCompressor(content)
46-
output = self.cache_get(compressor.cachekey)
46+
cachekey = "%s-%s" % (compressor.cachekey, self.mode)
47+
output = self.cache_get(cachekey)
4748
if output is None:
4849
try:
4950
if self.mode == OUTPUT_FILE:
5051
output = compressor.output()
5152
else:
5253
output = compressor.output_inline()
53-
self.cache_set(compressor.cachekey, output)
54+
self.cache_set(cachekey, output)
5455
except:
5556
from traceback import format_exc
5657
raise Exception(format_exc())

0 commit comments

Comments
 (0)