Co-Epi / coepi-backend-aws

CoEpi API back-end implementation deployed to Lambda, API Gateway and DynamoDB
MIT License
4 stars 14 forks source link

[coepi-backend-aws]: Enable CDN (Cloudfront) caching of reports #10

Open ramnanib2 opened 4 years ago

ramnanib2 commented 4 years ago

The API supports retrieving reports generated during a fixed time interval. This means that report batches for all intervals that have occurred in the past can be cached in CDN, optimizing latency and cost. Cloudfront is the CDN product that is available in AWS and can be used for this purpose. Some of the tasks that can be accomplished.

  1. API Gateway endpoint to be edge-optimized
  2. Enable caching using query string parameters as keys (intervalNumber is passed is as a query string parameter)
  3. Automate setting up the Cloudfront infrastructure using Terraform

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html

oidebrett commented 4 years ago

A possible implementation is available however this issue requires some consideration before rolling into the project.

Discussion document is here: https://docs.google.com/document/d/1c1bwQLWLqSGvcJnrhWPwmOgXTgnvwdG5mPNymSZGps0/edit?usp=sharing

Questions arising from investigation: