Created
September 2, 2019 10:22
-
-
Save cabdesigns/6937776b215cc0cfe639e0a5aa4d4606 to your computer and use it in GitHub Desktop.
Example Amplify build config with cache control headers
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
version: 0.1 | |
backend: | |
phases: | |
build: | |
commands: | |
- '# Execute Amplify CLI with the helper script' | |
- amplifyPush --simple | |
frontend: | |
phases: | |
preBuild: | |
commands: | |
- npm ci | |
build: | |
commands: | |
- npm run build | |
artifacts: | |
baseDirectory: build | |
files: | |
- '**/*' | |
cache: | |
paths: | |
- node_modules/**/* | |
customHeaders: | |
- pattern: '/favicon.ico' | |
headers: | |
- key: 'Cache-Control' | |
value: 'public, must-revalidate, max-age=31536000' | |
- pattern: '/static/**/*' | |
headers: | |
- key: 'Cache-Control' | |
value: 'public, must-revalidate, max-age=31536000' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment