Rewrite proxy pattern

Sometimes, you want to change the access destinations of static website content such as images and videos, but don't want to make changes to the existing systems. You can achieve this by providing a proxy server using rewrite proxy patterns. To change the destination of static content to other storage such as content service or internet storage, you can use a proxy server in front of the web server fleet. As shown in the following architecture diagram, you have a proxy server in front of your application layer, which helps to change the content delivery destination without modifying the actual application:

Rewrite proxy pattern architecture

As shown in the preceding diagram, to accomplish a rewrite proxy pattern, place the proxy server in front of the currently running system. You can construct a proxy server using software such as Apache NGINX. The following are the steps to build a rewrite proxy pattern:

  1. Put a running proxy server on an EC2 instance, which is able to overwrite the content between the Load balancer and the storage service such as Amazon S3, which stores the static content. 
  2. Add to the proxy server rules for overwriting URLs within the content. These rules will help Elastic Load Balancing (ELB) to point to a new location, as shown in the preceding diagram, which redirects the proxy server rule from https://cdn/test.jpg to /test.jpg.
  1. As required, apply Auto Scaling to the proxy servers by configuring a number of minimum and maximum proxy servers needed as per application load.

In this section, you learned about various ways to handle caching for static content distribution over the network. However, caching at the application layer is very important for improving application performance for overall user experience. Let's learn more about the app caching pattern to handle dynamic user data delivery performance.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.247.31