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
Our DB is very slow, our code very inefficient and our RAM is huge so we want to caché all the GET requests to our endpoints. Since we are not so naive, we know we need to invalidate that caché.
For that reason we want you to implement a middleware that does 2 things:
For every GET request we want you to save the response body to a global dictionary with the key being the request url for easy access. Next time someone asks for that path, you return the cache value instead of doing the controller call.
For every POST and PUT we want you to go that dictionary and clear the value. And any other cached value that might use that resource.
We don't want to caché the route /api/admin/billing/getChargeableStudents and might not want to caché other routes in the future.
Remember in order to capture the data sent on a response we can always redefine the res.response200 method in a new middleware.
The text was updated successfully, but these errors were encountered:
Our DB is very slow, our code very inefficient and our RAM is huge so we want to caché all the GET requests to our endpoints. Since we are not so naive, we know we need to invalidate that caché.
For that reason we want you to implement a middleware that does 2 things:
For every GET request we want you to save the response body to a global dictionary with the key being the request url for easy access. Next time someone asks for that path, you return the cache value instead of doing the controller call.
For every POST and PUT we want you to go that dictionary and clear the value. And any other cached value that might use that resource.
We don't want to caché the route
/api/admin/billing/getChargeableStudents
and might not want to caché other routes in the future.Remember in order to capture the data sent on a response we can always redefine the
res.response200
method in a new middleware.The text was updated successfully, but these errors were encountered: