T
T
tvbird2018-09-05 11:09:59
Nginx
tvbird, 2018-09-05 11:09:59

Dynamic content caching on NGINX, how to configure?

Hello, please tell me how to solve and whether it is possible to optimize this situation.
There is a Backend on the framework, every 35 seconds a GET request is sent to it from the application to the addresses:

backend/api/getstat/357
backend/api/getstat/25
backend/api/getstat/454
...

The backend itself executes the heavy request and caches its response in Redis for 1 minute.
The very same requests on the application timer can be about 100-10000 from different IPs.
The Get request itself is cached on the Backend, which helps to offload the server a bit, but in any case it reaches the Framework, and the latter is forced to use resources to return the cached response.
Actually the question is whether it is possible to somehow configure NGINX so that it caches this dynamic request for 1 minute and gives a response without a backend. The option to increase the polling time is not suitable :(

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Shatokhin, 2018-09-05
@Sovigod

Certainly. Use proxy_cache / fastcgi_cache depending on how you work with the backend in nginx

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question