feat(cache): add 30-day browser cache for uploaded images (middleware + S3 CacheControl)
This commit is contained in:
@@ -103,6 +103,7 @@ class S3Storage:
|
||||
def put(self, key: str, data: bytes, content_type: str = "image/jpeg") -> str:
|
||||
self._client.put_object(
|
||||
Bucket=self.bucket, Key=key, Body=data, ContentType=content_type,
|
||||
CacheControl="public, max-age=2592000, immutable",
|
||||
)
|
||||
return key
|
||||
|
||||
|
||||
Reference in New Issue
Block a user