- Create the project from the following template:
$ sls create --template-url https://github.com/danteinc/js-cloud-native-cookbook/tree/master/ch9/cache-control --path cncb-cache-control
- Navigate to the cncb-cache-control directory, cd cncb-cache-control.
- Review the file named serverless.yml.
- Review the file named handler.js with the following content:
module.exports.get = (request, context, callback) => { const response = { statusCode: 200, headers: { 'Cache-Control': 'max-age=5', }, body: ..., }; callback(null, response);};module.exports.save = (request, context, callback) => { const response = { statusCode: 200, headers: { 'Cache-Control': 'no-cache, no-store, must-revalidate', }, }; callback(null, response);};
- Install ...