Skip compression of already compressed files#347
Skip compression of already compressed files#347PetrDlouhy wants to merge 1 commit intoevansd:mainfrom
Conversation
|
@evansd Any updates on this? |
c413e16 to
d2cd64c
Compare
|
@lapinvert @adamchainz I have rebased this to the current Also this would be very easily achieved when #354 is merged by simple |
|
To me it sounds a no-brainer feature to have. For projects with many static files it makes a huge difference. |
| data = f.read() | ||
| size = len(data) | ||
| if self.use_brotli: | ||
| if self.use_brotli and not os.path.isfile(f"{path}.br"): |
There was a problem hiding this comment.
The file names are only unique when using the CompressedManifestStaticFilesStorage backend.
When using the CompressedStaticFilesStorage backend, this would cause WhiteNoise to never re-compress a file, even if its contents have changed
There was a problem hiding this comment.
Yes, exactly. And unfortunately, in the default config, the non-MD5-hashed names are left around and can still be served... This needs some more involved consideration, and tests.
New take on #296