jpwahle / cs-insights-backend

API server of the cs-insights project. This is the main part of storing data and accessing an external data analysis endpoint. It uses a mongoDB instance to store everything and queries the cs-insights-prediction-endpoint to get machine learning results.
https://jpwahle.github.io/cs-insights-backend/
MIT License
7 stars 0 forks source link

Add caching to preRead, preUpdate, preCreate middleware. #91

Closed jpwahle closed 2 years ago

jpwahle commented 2 years ago

Is your feature request related to a problem? Please describe. Instead of using custom queries, with #90 we can directly use the express-restify-mongoose framework to query the backend. Therefore we need to move the cache read implemented in #89 to the preRead, preUpdate, and preCretae middleware and move the cache write in the postRead middleware.

Describe the solution you'd like Whenever there is a read, the cache should be set. When there is a create, the cache should be deleted as the view is deprecated.