How can I optimize my REST API responses?

Hello everybody I’m creating a REST API with slim framework 4 also I’m using the architecture provided on the web called skeleton, the problem I have is that because the project is very large contains too many responses and this makes them run slowly, I want to run as fast as possible I would appreciate the example based on the architecture skeleton

the architecture of my project:

If it is really that big, you can split your code into separate modules for a good start. You don’t need to load all your routes, configs etc each time. Some cache might be useful.

Could you give me an example of how to manage the cache through the skeleton architecture