From e8783b15b1c594db08846b797092b58401a9749f Mon Sep 17 00:00:00 2001 From: mei23 Date: Thu, 26 Jul 2018 16:06:43 +0900 Subject: [PATCH] Set Cache-Control to object-storage --- src/services/drive/add-file.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/drive/add-file.ts b/src/services/drive/add-file.ts index dd41f4462..dbb1224cd 100644 --- a/src/services/drive/add-file.ts +++ b/src/services/drive/add-file.ts @@ -25,7 +25,7 @@ async function save(readable: stream.Readable, name: string, type: string, hash: const minio = new Minio.Client(config.drive.config); const id = uuid.v4(); const obj = `${config.drive.prefix}/${id}`; - await minio.putObject(config.drive.bucket, obj, readable, size, { 'Content-Type': type }); + await minio.putObject(config.drive.bucket, obj, readable, size, { 'Content-Type': type, 'Cache-Control': 'max-age=31536000, immutable' }); Object.assign(metadata, { withoutChunks: true,