I have been given a project recently where REST API have been implemented in the most basic way possible i.e. request comes to app, app hits controller, queries db, returns response.
So this mechanism, as its quite obvious, has started to create issues in terms of response times as data has grown a lot. Plus this approach also hogs the infrastructure a lot as well through its processing.
Now, I'm familiar with caching mechanisms for APIs and non API things, but what are the recommended ways to do it in case of APIs? Also, what do we need to add in terms of infrastructure and code modules to handle such sort of a thing?
Some test cases for different approaches would be really nice by any of the well-versed folks.