Add an application cache for REST API
Description:
Very preliminary draft to get feedback on general approach to the solution. There is still more implementation and testing to be done.
There are many times that the same request from different sessions all hit our REST server even though cloud CDN is enabled and the responses have proper cache control header set.
There are also periodic high rate of response code 304 from our REST server because some clients will issue a HEAD request with cache id to probe if the cache is still valid. Due to lack of head handler in our js REST module, it ends up to go though the get handler and query data, then expressjs learns the cache is still valid, zeros out the response body and sends a 304 response.
We should add a application layer cache to handle such scenarios so the rest server doesn't unnecessarily go to the database for the data.
Related issue(s):
Fixes #9111
Notes for reviewer:
- Still working out Snyk code security check failure.
- Working on getting performance testing results.
- Determine Redis
maxMemory.
Checklist
- [ ] Documented (Code comments, README, etc.)
- [ ] Tested (unit, integration, etc.)