-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upload assets to S3 with Cache-Control header set
We want to be able to redirect Asset Manager requests to the assets stored in an S3 bucket. However, we want as much of the externally-visible behaviour to remain the same and so we need to set the 'Cache-Control' header to the same value as in `MediaController#download`, i.e. the value generated by `ActionController::ConditionalGet#expires_in` [1] using `ApplicationController#set_expiry`. Note that the header is set on the S3 object at the point where it is uploaded. See the documentation for `Aws::S3::Object#upload_file` [2]. [1]: http://api.rubyonrails.org/v4.2.7.1/classes/ActionController/ConditionalGet.html#method-i-expires_in [2]: http://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Object.html#upload_file-instance_method
- Loading branch information
1 parent
278f180
commit 1122e48
Showing
6 changed files
with
47 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters