Skip to content

Commit

Permalink
Add cache control to s3 objects
Browse files Browse the repository at this point in the history
  • Loading branch information
mfinelli committed Jun 8, 2019
1 parent ab5d37e commit 7131c19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This file keeps track of changes between releases for the bankrupt project
which adheres to [semantic versioning](https://semver.org).

## unreleased

* Set cache-control header on objects uploaded to s3 (1 year).

## v1.1.0 2019-06-05

Add support for `img` tags along with the ability to add other attributes.
Expand Down
3 changes: 2 additions & 1 deletion lib/bankrupt/tasks.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Copyright 2018 Mario Finelli
# Copyright 2018-2019 Mario Finelli
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,6 +42,7 @@
# content_md5: Base64.strict_encode64(asset[:md5]),
content_length: File.size(f),
content_type: MiniMime.lookup_by_filename(f).content_type,
cache_control: 'public, max-age=31536000',
server_side_encryption: 'AES256',
storage_class: 'STANDARD',
metadata: {
Expand Down

0 comments on commit 7131c19

Please sign in to comment.