Hash the file path in the mtime cache key.
This commit is contained in:
@@ -10,11 +10,11 @@ def get_hexdigest(plaintext):
|
||||
return sha_constructor(plaintext).hexdigest()
|
||||
|
||||
def get_mtime_cachekey(filename):
|
||||
return "django_compressor.mtime.%s" % filename
|
||||
return "django_compressor.mtime.%s" % get_hexdigest(filename)
|
||||
|
||||
def get_offline_cachekey(source):
|
||||
return ("django_compressor.offline.%s"
|
||||
% get_hexdigest("".join(smart_str(s) for s in source)))
|
||||
return ("django_compressor.offline.%s" %
|
||||
get_hexdigest("".join(smart_str(s) for s in source)))
|
||||
|
||||
def get_mtime(filename):
|
||||
if settings.COMPRESS_MTIME_DELAY:
|
||||
@@ -31,5 +31,4 @@ def get_hashed_mtime(filename, length=12):
|
||||
mtime = str(int(get_mtime(filename)))
|
||||
return get_hexdigest(mtime)[:length]
|
||||
|
||||
|
||||
cache = get_cache(settings.COMPRESS_CACHE_BACKEND)
|
||||
|
||||
Reference in New Issue
Block a user