pow-co / askbitcoin

Ask Bitcoin a Question - Bitcoin AI Ranks the Top Answers
7 stars 5 forks source link

Cache API responses to decrease load time 80+% #67

Open owenkellogg opened 1 year ago

owenkellogg commented 1 year ago

Major API calls should be cached in memory (redis to scale) and returned instantly without a database query. Whenever new data arrives in the database, trigger a cache refresh. Also whenever a user requests resource the cache can be refreshed after responding to the user.

owenkellogg commented 1 year ago

https://blog.logrocket.com/caching-node-js-optimize-app-performance/

1aristotelis commented 1 year ago

i thought swr had caching built-in. is it not enough ?

owenkellogg commented 1 year ago

Caching on the back end to reduce page load times rather than running heavy SQL queries on every request.