api icon indicating copy to clipboard operation
api copied to clipboard

Feature: utilize in memory cache provider

Open jpmcb opened this issue 4 months ago • 0 comments

Type of feature

🍕 Feature

Current behavior

Currently, we do not do any caching on the API side: all data is always fetched from the postgres database or timescale.

Suggested solution

Nest offers a fairly easy way to use a cache:

https://docs.nestjs.com/techniques/caching

the default provider is an in-memory one but we can always easily switch to something like Redis in the future.

If we're finding that we're hitting the database too often with frequent queries and https://github.com/open-sauced/api/issues/566 isn't enough, we should look at doing this as well.

Additional context

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Contributing Docs

  • [X] I agree to follow this project's Contribution Docs

jpmcb avatar Feb 19 '24 15:02 jpmcb