mirror of
https://github.com/zulip/zulip.git
synced 2025-10-28 18:43:52 +00:00
thumbnail: Disable libvips cache.
The libvips cache is 100MB, 100 operations, or 100 files, whichever is less. A single Django process or worker is extremely unlikely to ever see the same image twice, much less within those timeframes. Disable the cache, since it is mostly useless memory usage for our use case.
This commit is contained in:
committed by
Tim Abbott
parent
1e42d60850
commit
3ac14632d8
@@ -132,6 +132,10 @@ pyvips.operation_block_set("VipsForeignLoadTiff", False) # image/tiff
|
||||
pyvips.operation_block_set("VipsForeignLoadWebp", False) # image/webp
|
||||
pyvips.block_untrusted_set(True)
|
||||
|
||||
# Disable the operations cache; our only use here is thumbnail_buffer,
|
||||
# which does not make use of it.
|
||||
pyvips.voperation.cache_set_max(0)
|
||||
|
||||
|
||||
class BadImageError(JsonableError):
|
||||
code = ErrorCode.BAD_IMAGE
|
||||
|
||||
Reference in New Issue
Block a user