A typical WordPress public website hosted on Apache Server is usually configured in such a way that a page is generated in realtime from the Database. This is because all of WordPress Pages, Post and other taxonomy are saved in MySQL Databases.
In simple words, when there is a request for the same page or post twice there will be two connections that will be opened with database and two pages will be generated. Which will increase the load on database query etc. If there is caching in place the page will be generated once and then the second request will be serve via cache. Which will improve the performance of your WordPress site. No website can call itself optimized without a caching system in place.
Here’s a quick list of the different types of caching we can identify:
- Page cache: it happens on the server and stores the entire HTML of a page (as WP Rocket does);
- Browser cache: it keeps storing the HTML but occurs on the browser;
- Object cache: it stores database queries;
- Bytecode cache: it’s a PHP extension and stores precompiled script bytecode in the memory;
- CDN cache: it occurs on the CDN-side and stores the HTML and all other static files (images, CSS and JS);
- Reverse proxy cache: it happens on the server’s side and stores all its responses to the client’s server.
In this article, we’re going to focus on this last type of caching and, in particular, to one of the most popular HTTP reverse proxies: NginX Reverse Proxy Server. TDWS Products like Managed WordPress Hosting and TDWS CloudSites have NginX Reverse Proxy as an option, giving your website an ability to scale faster.
What is HTTP Reverse Proxies?
A proxy server is a go‑between or intermediary server that forwards requests for content from multiple clients to different servers across the Internet. A reverse proxy server is a type of proxy server that typically sits behind the firewall in a private network and directs client requests to the appropriate backend server. A reverse proxy provides an additional level of abstraction and control to ensure the smooth flow of network traffic between clients and servers.
One reason to proxy to other servers from Nginx is the ability to scale out your infrastructure. Nginx is built to handle many concurrent connections at the same time. This makes it ideal for being the point-of-contact for clients. The server can pass requests to any number of backend servers to handle the bulk of the work, which spreads the load across your infrastructure. This design also provides you with flexibility in easily adding backend servers or taking them down as needed for maintenance.
Another instance where an HTTP proxy might be useful is when using application servers that might not be built to handle requests directly from clients in production environments. Many frameworks include web servers, but most of them are not as robust as servers designed for high performance like Nginx. Putting Nginx in front of these servers can lead to a better experience for users and increased security.
Proxying in Nginx is accomplished by manipulating a request aimed at the Nginx server and passing it to other servers for the actual processing. The result of the request is passed back to Nginx, which then relays the information to the client. The other servers in this instance can be remote machines, local servers, or even other virtual servers defined within Nginx. The servers that Nginx proxies requests to are known as upstream servers.
What are the advantages of using a reverse proxy
Here the reverse proxy handles incoming HTTPS connections, decrypting the requests and passing unencrypted requests on to the web servers. This has several benefits:
- Removes the need to install certificates on many back end web servers.
- Provides a single point of configuration and management for SSL/TLS
- Takes the processing load of encrypting/decrypting HTTPS traffic away from web servers.
- Makes testing and intercepting HTTP requests to individual web servers easier.
Serving Static Content
The reverse proxy can also act as a cache. You can either have a dumb cache that simply expires after a set period, or better still a cache that respects Cache-Control and Expires headers. This can considerably reduce the load on the back-end servers.
A reverse proxy server can act as a “traffic cop,” sitting in front of your backend servers and distributing client requests across a group of servers in a manner that maximizes speed and capacity utilization while ensuring no one server is overloaded, which can degrade performance. If a server goes down, the load balancer redirects traffic to the remaining online servers.
Reverse proxies can compress inbound and outbound data, as well as cache commonly requested content, both of which speed up the flow of traffic between clients and servers. They can also perform additional tasks such as SSL encryption to take load off of your web servers, thereby boosting their performance.
By intercepting requests headed for your backend servers, a reverse proxy server protects their identities and acts as an additional
In order to reduce the bandwidth needed for individual requests, the reverse proxy can decompress incoming requests and compress outgoing ones. This reduces the load on the back-end servers that would otherwise have to do the compression, and makes debugging requests to, and responses from, the back-end servers easier.
Centralised Logging and Auditing
Because all HTTP requests are routed through the reverse proxy, it makes an excellent point for logging and auditing.
How to Use NginX Reverse proxy on Your WordPress Site?
While hosting with TDWS Managed WordPress or TDWS CloudSites, we make it extremly simple for our clients to manage and configure NginX Caching and Reverse Proxy.
Activate NginX Caching in Managed WordPress
The whole activation will take just a single click. Login to your WordPress Management panel and just enable the button for NginX Cache (images attached)
Activate NginX Caching for other applications
Step 1: Login to your TDWS CloudSites Control Panel
Once you login click on Apache & NginX setting
Step 2: Select NginX Setting
That’s It! You are done!
TD Web Services makes it extremely easy for anyone to use and accelerate their website using reverse proxy of NginX. If there is additional support that is required, we are always here to give you support or if you want our team to enable and setup NginX for you, just open a ticket and we will do it for you.