diff --git a/backend/src/uploads/s3Service.ts b/backend/src/uploads/s3Service.ts index bf82d6238..cc7fa3592 100644 --- a/backend/src/uploads/s3Service.ts +++ b/backend/src/uploads/s3Service.ts @@ -43,6 +43,7 @@ export const s3Service = (config: S3Config, prefix: string) => { Bucket, Key: s3Location, ACL: ObjectCannedACL.public_read, + CacheControl: 'public, max-age=604800', // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment ContentType: mimetype, // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call diff --git a/deployment/helm/charts/ocelot-social/templates/imagor/deployment.yaml b/deployment/helm/charts/ocelot-social/templates/imagor/deployment.yaml index 80bac5e8b..2168db110 100644 --- a/deployment/helm/charts/ocelot-social/templates/imagor/deployment.yaml +++ b/deployment/helm/charts/ocelot-social/templates/imagor/deployment.yaml @@ -23,6 +23,8 @@ spec: env: - name: S3_FORCE_PATH_STYLE value: "1" + - name: IMAGOR_CACHE_HEADER_TTL + value: "168h" envFrom: - secretRef: name: {{ .Release.Name }}-imagor-secret-env diff --git a/docker-compose.override.yml b/docker-compose.override.yml index c8c2107a5..b52fe2c54 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -90,6 +90,7 @@ services: S3_STORAGE_BUCKET: ocelot # enable S3 storage by specifying bucket S3_RESULT_STORAGE_BUCKET: ocelot # enable S3 result storage by specifying bucket HTTP_LOADER_BASE_URL: http://minio:9000 + IMAGOR_CACHE_HEADER_TTL: 168h # 7 days ui: image: ghcr.io/ocelot-social-community/ocelot-social/ui:local-development