Skip to content
Snippets Groups Projects
Unverified Commit 9d039209 authored by Matt Corallo's avatar Matt Corallo Committed by GitHub
Browse files

Add `Cache-Control` header to openstack-stored files (#20610)

When storing files in S3, paperclip is configured with a Cache-Control header
indicating the file is immutable, however no such header was added when using
OpenStack storage.

Luckily Paperclip's fog integration makes this trivial, with a simple
`fog_file` `Cache-Control` default doing the trick.
parent d0b7bd42
No related branches found
No related tags found
No related merge requests found
......@@ -125,6 +125,8 @@ elsif ENV['SWIFT_ENABLED'] == 'true'
openstack_region: ENV['SWIFT_REGION'],
openstack_cache_ttl: ENV.fetch('SWIFT_CACHE_TTL') { 60 },
},
fog_file: { 'Cache-Control' => 'public, max-age=315576000, immutable' },
fog_directory: ENV['SWIFT_CONTAINER'],
fog_host: ENV['SWIFT_OBJECT_URL'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment