You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the caching logic is written in the API routes. In order to facilitate the reuse in potential other routes and clean up API route code, it would be beneficial to create a reusable module that reads and udates the cache. This involves the following steps:
Create a new module containing caching logic. This should provide functionality for reading from the cache, and automatically refreshing the cache on a miss. You could possibly use a callback to specify how to fetch new data from the DB.
Move caching logic from API routes to the new caching module.
Create a middleware that calls the caching module for requests that need to be cached. (Might not be necessary)
The text was updated successfully, but these errors were encountered:
Currently, the caching logic is written in the API routes. In order to facilitate the reuse in potential other routes and clean up API route code, it would be beneficial to create a reusable module that reads and udates the cache. This involves the following steps:
The text was updated successfully, but these errors were encountered: