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.lolsob-rspec
parent
72de8402bd
commit
88b46d0a8f
|
@ -126,6 +126,8 @@ elsif ENV['SWIFT_ENABLED'] == 'true'
|
||||||
openstack_cache_ttl: ENV.fetch('SWIFT_CACHE_TTL') { 60 },
|
openstack_cache_ttl: ENV.fetch('SWIFT_CACHE_TTL') { 60 },
|
||||||
},
|
},
|
||||||
|
|
||||||
|
fog_file: { 'Cache-Control' => 'public, max-age=315576000, immutable' },
|
||||||
|
|
||||||
fog_directory: ENV['SWIFT_CONTAINER'],
|
fog_directory: ENV['SWIFT_CONTAINER'],
|
||||||
fog_host: ENV['SWIFT_OBJECT_URL'],
|
fog_host: ENV['SWIFT_OBJECT_URL'],
|
||||||
fog_public: true
|
fog_public: true
|
||||||
|
|
Loading…
Reference in New Issue