FIX: S3 uploads were missing a cache-control header (#7902)

Admins still need to run the rake task to fix the files who where uploaded previously.
This commit is contained in:
Rafael dos Santos Silva
2019-08-06 14:55:17 -03:00
committed by GitHub
parent 4b9d35cd0e
commit 606c0ed14d
2 changed files with 45 additions and 0 deletions

View File

@ -43,6 +43,7 @@ module FileStore
cache_file(file, File.basename(path)) if opts[:cache_locally]
options = {
acl: opts[:private] ? "private" : "public-read",
cache_control: 'max-age=31556952, public, immutable',
content_type: opts[:content_type].presence || MiniMime.lookup_by_filename(filename)&.content_type
}
# add a "content disposition" header for "attachments"