Take output mode into account when caching the template tag output.
This commit is contained in:
@@ -43,14 +43,15 @@ class CompressorNode(template.Node):
|
||||
compressor = CssCompressor(content)
|
||||
if self.kind == 'js':
|
||||
compressor = JsCompressor(content)
|
||||
output = self.cache_get(compressor.cachekey)
|
||||
cachekey = "%s-%s" % (compressor.cachekey, self.mode)
|
||||
output = self.cache_get(cachekey)
|
||||
if output is None:
|
||||
try:
|
||||
if self.mode == OUTPUT_FILE:
|
||||
output = compressor.output()
|
||||
else:
|
||||
output = compressor.output_inline()
|
||||
self.cache_set(compressor.cachekey, output)
|
||||
self.cache_set(cachekey, output)
|
||||
except:
|
||||
from traceback import format_exc
|
||||
raise Exception(format_exc())
|
||||
|
Reference in New Issue
Block a user