Nothing here yet.
Nothing here yet.
Hello Guillaume, It's definitely better practice to put the cache logic in a middleware function and not directly inside a route handler. This way if you have multiple routes that needs to be cached, you can just call the middleware. Imagine adding the cache logic directly into your routes, that will be messy. It's just like have different routes that only an authenticated user can have access to. Note: If you query the /repos/:username endpoint and the cache already exists, yes, it returns the same response but this time, much faster. I hope that was helpful. 😃