Skip to content

Instantly share code, notes, and snippets.

@guilhermevini
Created July 30, 2019 03:15
Show Gist options
  • Save guilhermevini/c0d60fac4e77c155744352ec739f87ce to your computer and use it in GitHub Desktop.
Save guilhermevini/c0d60fac4e77c155744352ec739f87ce to your computer and use it in GitHub Desktop.
exports.handler = (event, context, callback) => {
const response = event.Records[0].cf.response;
if (!response.headers['cache-control']) {
response.headers['cache-control'] = [{
key: 'Cache-Control',
value: 'max-age=31536000'
}];
}
callback(null, response);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment