TruBudget
TruBudget copied to clipboard
api: re-implement cache with node-cache to add ttl for cache entities
Checklist
- [x] I have followed (at least) the PR section of the contributing guide.
- [x] I fixed all necessary PR warnings
- [x] The commit history is clean
- [x] The E2E tests are passing
- [x] If possible, the issue has been divided into more subtasks
- [x] I did a self review before requesting a review from another team member
Description
Solves API-Heap problems by adding a TTL for cache entities
Closes #1108
Warnings | |
---|---|
:warning: | No CHANGELOG added. |
Generated by :no_entry_sign: dangerJS against b586f9b4ac94777901e6f91407886a280ab8a340
Notes | Time | |
---|---|---|
:x: | Note for Reviewer: E2E tests on remote server failed | Wed, 07 Sep 2022 08:41:28 +0000 |
Generated by E2E-Test
This PR introduces a time to live for the cache - 10 mins. Every 10 mins the cache is cleared, after which a new request to the api (that uses the withCache()
) function will trigger the cache to reload. Our purpose was to help with the api heap problems (issue #1108), however only a ttl does not fix the problem, because the cache is still filled again on a new request after it is cleared.
In order to fix the issue, we need to improve the caching startegy overall, which will be discussed in a separate discussion #1290
This PR will be closed and after the discussion is finished we hope to fix this issue with a new PR