Merge pull request #1989 from mei23/mei-oscc

オブジェクトストレージ格納時にCache-Controlを指定する
This commit is contained in:
syuilo 2018-07-27 01:52:19 +09:00 committed by GitHub
commit f7b0fedc9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,