How to enable NGINX caching to speed up your servers and sites
Web cache is a form of information technology, involving the temporary storage of web documents such as HTML pages and images. You need it because it helps alleviate server lag – speeding up servers and websites considerably. You can access a variety of web cache technologies, such as Polipo, Squid and Varnish. But, because of two main factors, administrators are increasingly choosing to enable NGINX caching as an alternative.
- NGINX serves static content in an efficient way, meaning it’s an important asset when static files are on the same server as NGINX.
- NGINX can act as a ‘true’ cache server when it’s in front of an application server.
If you want to enable NGINX caching for your server and websites, you can do so by using the latest version of Plesk Obsidian.
Benefits of NGINX caching
NGINX is a versatile technology, as it can proxy requests to other web servers or apps. By doing this, it increases performance for serving static files. While other proxying applications request to other processes. Moreover, NGINX can also act as a cache server, so it can cache content from other servers.
NGINX can sit ‘in front’ of web servers where it acts as a gateway to other applications or servers – in a way similar to a load balancer. Additionally, it can also cache the results of requests proxied to FastCGI and uWSGI processes, as well as to other HTTP servers.
Getting started with NGINX caching
When administrators enable NGINX caching, they get access to the NGINX proxy server. With this, they can cache certain dynamic website content. When this happens, cached data is stored for a very small period of time, usually no more than several seconds. As a result, you’ll see an overall increase in speed of website load time. Plus a reduction in server load.
You should consider NGINX caching depending on a website’s profile and usage. So if you have a website that experiences high traffic or that you regularly upload content to every few seconds, you should enable NGINX caching for it. This includes websites such as popular blogs and news portals.
On the other hand, enabling NGINX caching for websites that have low or moderate traffic and fewer content updates might be potentially harmful, or simply plain pointless. The same scenario applies for websites that use personalized content, like those that take note of a visitor’s geographical location or the contents of a shopping cart.
You can also enable NGINX caching for individual domains and hosting plans. In fact, every time you create a new subscription based on a current hosting plan, NGINX caching is automatically enabled.
NGINX customization is important
As with most technologies, you have the option to customize your default NGINX caching settings directly on your Plesk panel. For example, you can change features, such as cache size and cache timeout. Plus maximum cache size, the cache key, and so on.
You can do this by editing the panel.ini file. When administrators customize settings, the new custom values only apply to new hosting plans, domains, and subdomains. And won’t affect those hosting plans, domains, etc. that already exist.
Before you enable NGINX caching, we highly recommend you switch PHP files processing to a PHP-FPM application served by an NGINX type.
A cache server such as NGINX is a great way for administrators to put less load on their servers and websites. With its versatile nature, being used for both static or dynamic assets, NGINX caching can handle numerous requests by itself. This brilliant feature is available in the latest version of Plesk Obsidian, which comes with a comprehensive installation guide.
Will you enable NGINX caching to speed up your servers and sites? Let us know in the comments below.
How useful was this post?
Click on a heart to rate it!
Average rating 3.6 / 5. Vote count: 5
Oh no, sorry about that!
Let us know how we can do better below
Thanks for your feedback!