camicroscope / Caracal

Conslidated Backend, Auth, and Security Services for caMicroscope
GNU General Public License v3.0
15 stars 94 forks source link

Refactored index.js for better caching #173

Closed gbengaoluwadahunsi closed 5 months ago

gbengaoluwadahunsi commented 6 months ago

Summary Enhanced caching logic has been added to the find method in the index.js file. This update ensures that data retrieval from the cache is prioritized before querying the database, thereby optimizing performance.

Motivation The motivation behind this pull request is to enrich the caching mechanism in the find method. By implementing more robust caching logic, we aim to further improve application performance and reduce the load on the database.

Testing Extensive testing has been conducted to validate the effectiveness of the updated caching logic.

Screenshot 2024-03-25 001619 landing2

birm commented 5 months ago

I don't see anything like a time to live here, and I don't know where cache is coming from; it looks like it's default true? Wouldn't this mean that adding an annotation, for example, wouldn't reflect ever?

gbengaoluwadahunsi commented 5 months ago

Oooh, I got your question now @birm

It's true, by default, caching is true

Thank you for that clarification @birm.

I will proceed to use Redis for the client-side caching.