Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #57 from ferdinandfrank/enable-static-caching
Browse files Browse the repository at this point in the history
Add 'Cache-Control' header for static files on S3
  • Loading branch information
wan2land committed Apr 12, 2020
2 parents cf6e0a9 + bf654a1 commit 68891b5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/serverless-nuxt-plugin/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ class ServerlessNuxtPlugin {
Body: fs.readFileSync(file),
ACL: 'public-read',
ContentType: mime.lookup(file) || null,
CacheControl: 'public, max-age=31536000', // let the browser cache all static files for 1 year since they receive a unique hash by Nuxt
}).promise()
}))

Expand Down

0 comments on commit 68891b5

Please sign in to comment.