Skip to content

Instantly share code, notes, and snippets.

@cabdesigns
Created September 2, 2019 10:22
Show Gist options
  • Save cabdesigns/6937776b215cc0cfe639e0a5aa4d4606 to your computer and use it in GitHub Desktop.
Save cabdesigns/6937776b215cc0cfe639e0a5aa4d4606 to your computer and use it in GitHub Desktop.
Example Amplify build config with cache control headers
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