- Hands-On Enterprise Application Development with Python
- Saurabh Badhwar
- 214字
- 2021-07-02 14:38:14
Serving static resources
Most of the web applications have two kind of resources that they serve. One is the dynamic responses generated in accordance to the external input and static content that remains the same, such as CSS files, Javascript files, images, and so on.
It provides a lot of performance gain as well as improved scalability if we can offload either one of these responsibilities from the web application.
The best possibility that we have here is to offload the serving of static resources to the clients. A reverse proxy can also double up as a server which can serve the static resources to the clients without forwarding these requests to the web application server, which dramatically reduces the number of requests waiting to be processed by the web application, hence resulting in improved capability to handle the dynamic requests by the application.
With the use of a reverse proxy in front of the application we are trying to develop, we can now better handle the large number of incoming concurrent clients while also taking off some of the load which the application server might had to deal with to serve the static resources for every request or for other operations which may include termination of SSL, balancing of the load, etc.