diff --git a/packages/emails/emails.go b/packages/emails/emails.go index a15f1cd8a..c5840d805 100644 --- a/packages/emails/emails.go +++ b/packages/emails/emails.go @@ -190,7 +190,8 @@ func UploadStaticAssets(ctx context.Context, s3Client *s3.Client, staticAssetsBu Metadata: map[string]string{ "type": "static-email-asset", }, - ContentType: aws.String(mimeType), + ContentType: aws.String(mimeType), + CacheControl: aws.String("max-age=3600, public"), }, ) if err != nil { diff --git a/pkg/filemanager/service.go b/pkg/filemanager/service.go index 4837f41fc..659d441c3 100644 --- a/pkg/filemanager/service.go +++ b/pkg/filemanager/service.go @@ -129,11 +129,12 @@ func (s *Service) PutFile( _, err := s.s3Client.PutObject( ctx, &s3.PutObjectInput{ - Bucket: aws.String(file.GetBucketName()), - Key: aws.String(file.GetObjectKey()), - Body: content, - ContentType: aws.String(file.GetMimeType()), - Metadata: metadata, + Bucket: aws.String(file.GetBucketName()), + Key: aws.String(file.GetObjectKey()), + Body: content, + ContentType: aws.String(file.GetMimeType()), + CacheControl: aws.String("private, max-age=3600"), + Metadata: metadata, }, ) if err != nil { diff --git a/pkg/probo/audit_service.go b/pkg/probo/audit_service.go index 50805b09c..538249a3f 100644 --- a/pkg/probo/audit_service.go +++ b/pkg/probo/audit_service.go @@ -347,10 +347,11 @@ func (s AuditService) UploadReport( } _, err = s.svc.s3.PutObject(ctx, &s3.PutObjectInput{ - Bucket: aws.String(s.svc.bucket), - Key: aws.String(objectKey.String()), - Body: req.File.Content, - ContentType: aws.String(req.File.ContentType), + Bucket: aws.String(s.svc.bucket), + Key: aws.String(objectKey.String()), + Body: req.File.Content, + ContentType: aws.String(req.File.ContentType), + CacheControl: aws.String("private, max-age=3600"), Metadata: map[string]string{ "type": "report", "report-id": reportID.String(), diff --git a/pkg/probo/document_service.go b/pkg/probo/document_service.go index 48f6d2ae1..a5a6bf5b6 100644 --- a/pkg/probo/document_service.go +++ b/pkg/probo/document_service.go @@ -1792,6 +1792,7 @@ func (s *DocumentService) BuildAndUploadExport(ctx context.Context, exportJobID Body: tempFile, ContentLength: ref.Ref(fileInfo.Size()), ContentType: ref.Ref("application/zip"), + CacheControl: ref.Ref("private, max-age=3600"), Metadata: map[string]string{ "type": "document-export", "export-job-id": exportJob.ID.String(), diff --git a/pkg/probo/file_service.go b/pkg/probo/file_service.go index 230b61901..16f4f8c3d 100644 --- a/pkg/probo/file_service.go +++ b/pkg/probo/file_service.go @@ -96,11 +96,12 @@ func (s FileService) UploadAndSaveFile( _, err = s.svc.s3.PutObject( ctx, &s3.PutObjectInput{ - Bucket: &s.svc.bucket, - Key: aws.String(objectKey.String()), - Body: req.Content, - Metadata: s3Metadata, - ContentType: aws.String(mimeType), + Bucket: &s.svc.bucket, + Key: aws.String(objectKey.String()), + Body: req.Content, + Metadata: s3Metadata, + ContentType: aws.String(mimeType), + CacheControl: aws.String("private, max-age=3600"), }, ) if err != nil { diff --git a/pkg/probo/framework_service.go b/pkg/probo/framework_service.go index 1b7c08f60..6b52cc86d 100644 --- a/pkg/probo/framework_service.go +++ b/pkg/probo/framework_service.go @@ -729,6 +729,7 @@ func (s *FrameworkService) BuildAndUploadExport(ctx context.Context, exportJobID Body: tempFile, ContentLength: ref.Ref(fileInfo.Size()), ContentType: ref.Ref("application/zip"), + CacheControl: ref.Ref("private, max-age=3600"), Metadata: map[string]string{ "type": "framework-export", "export-job-id": exportJob.ID.String(), diff --git a/pkg/probo/trust_center_file_service.go b/pkg/probo/trust_center_file_service.go index 2cdede344..1089d3d5e 100644 --- a/pkg/probo/trust_center_file_service.go +++ b/pkg/probo/trust_center_file_service.go @@ -375,10 +375,11 @@ func (s TrustCenterFileService) uploadFile( } _, err = s.svc.s3.PutObject(ctx, &s3.PutObjectInput{ - Bucket: aws.String(s.svc.bucket), - Key: aws.String(objectKey.String()), - Body: fileContent, - ContentType: aws.String(contentType), + Bucket: aws.String(s.svc.bucket), + Key: aws.String(objectKey.String()), + Body: fileContent, + ContentType: aws.String(contentType), + CacheControl: aws.String("private, max-age=3600"), Metadata: map[string]string{ "type": "trust-center-file", "trust-center-file-id": trustCenterFileID.String(), diff --git a/pkg/probo/trust_center_reference_service.go b/pkg/probo/trust_center_reference_service.go index c47e67069..e96ed896f 100644 --- a/pkg/probo/trust_center_reference_service.go +++ b/pkg/probo/trust_center_reference_service.go @@ -395,10 +395,11 @@ func (s TrustCenterReferenceService) uploadLogoFile( } _, err = s.svc.s3.PutObject(ctx, &s3.PutObjectInput{ - Bucket: aws.String(s.svc.bucket), - Key: aws.String(objectKey.String()), - Body: fileContent, - ContentType: aws.String(contentType), + Bucket: aws.String(s.svc.bucket), + Key: aws.String(objectKey.String()), + Body: fileContent, + ContentType: aws.String(contentType), + CacheControl: aws.String("max-age=3600, public"), Metadata: map[string]string{ "type": "trust-center-reference-logo", "trust-center-reference-id": referenceID.String(), diff --git a/pkg/probo/trust_center_service.go b/pkg/probo/trust_center_service.go index 515bca891..5541c57fe 100644 --- a/pkg/probo/trust_center_service.go +++ b/pkg/probo/trust_center_service.go @@ -231,10 +231,11 @@ func (s TrustCenterService) UploadNDA( mimeType := mime.TypeByExtension(filepath.Ext(req.FileName)) _, err := s.svc.s3.PutObject(ctx, &s3.PutObjectInput{ - Bucket: &s.svc.bucket, - Key: aws.String(objectKey.String()), - Body: req.File, - ContentType: &mimeType, + Bucket: &s.svc.bucket, + Key: aws.String(objectKey.String()), + Body: req.File, + ContentType: &mimeType, + CacheControl: aws.String("private, max-age=3600"), Metadata: map[string]string{ "type": "trust-center-nda", "trust-center-id": req.TrustCenterID.String(), @@ -408,10 +409,11 @@ func (s TrustCenterService) uploadFile( } _, err = s.svc.s3.PutObject(ctx, &s3.PutObjectInput{ - Bucket: &s.svc.bucket, - Key: aws.String(objectKey.String()), - Body: fileUpload.Content, - ContentType: &mimeType, + Bucket: &s.svc.bucket, + Key: aws.String(objectKey.String()), + Body: fileUpload.Content, + ContentType: &mimeType, + CacheControl: aws.String("max-age=3600, public"), Metadata: map[string]string{ "type": fileType, "trust-center-id": trustCenter.ID.String(), diff --git a/pkg/probo/vendor_business_associate_agreement_service.go b/pkg/probo/vendor_business_associate_agreement_service.go index 1c14ebe21..55f7f9f5f 100644 --- a/pkg/probo/vendor_business_associate_agreement_service.go +++ b/pkg/probo/vendor_business_associate_agreement_service.go @@ -126,10 +126,11 @@ func (s VendorBusinessAssociateAgreementService) Upload( mimeType := mime.TypeByExtension(filepath.Ext(req.FileName)) _, err := s.svc.s3.PutObject(ctx, &s3.PutObjectInput{ - Bucket: &s.svc.bucket, - Key: aws.String(objectKey.String()), - Body: req.File, - ContentType: &mimeType, + Bucket: &s.svc.bucket, + Key: aws.String(objectKey.String()), + Body: req.File, + ContentType: &mimeType, + CacheControl: aws.String("private, max-age=3600"), Metadata: map[string]string{ "type": "vendor-business-associate-agreement", "vendor-id": vendorID.String(), diff --git a/pkg/probo/vendor_data_privacy_agreement_service.go b/pkg/probo/vendor_data_privacy_agreement_service.go index 618640033..f47ee76bf 100644 --- a/pkg/probo/vendor_data_privacy_agreement_service.go +++ b/pkg/probo/vendor_data_privacy_agreement_service.go @@ -126,10 +126,11 @@ func (s VendorDataPrivacyAgreementService) Upload( mimeType := mime.TypeByExtension(filepath.Ext(req.FileName)) _, err := s.svc.s3.PutObject(ctx, &s3.PutObjectInput{ - Bucket: &s.svc.bucket, - Key: aws.String(objectKey.String()), - Body: req.File, - ContentType: &mimeType, + Bucket: &s.svc.bucket, + Key: aws.String(objectKey.String()), + Body: req.File, + ContentType: &mimeType, + CacheControl: aws.String("private, max-age=3600"), Metadata: map[string]string{ "type": "vendor-data-privacy-agreement", "vendor-id": vendorID.String(),