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.

  1. NGINX serves static content in an efficient way, meaning it’s an important asset when static files are on the same server as NGINX.
  2. 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 caching - benefits

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

NGINX Caching - Getting started

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

NGINX Customization

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.

arrow icon - Plesk

4 Comments

  1. Hi,
    I would like to active Nginx caching on Plesk Obsidian in order to decrease my TTFB.
    But my websites have low trafic and The content is updated every days.

    Is it a good option ? I would like that Nginx serve cached HTML content instead of processing PHP with Apache

    Thanks

    • Hey Eric,

      If you have low traffic, you may not need this, however, you can give that a try and see how it works in this particular case. As always, you should check and test each website for optimal configurations. Let us know how it turns out!

  2. Hi there. Is there any way in Plesk while using the caching system to be purged or something from WordPress? Otherwise how can you purge it? Best Regards

Add a Comment

Your email address will not be published. Required fields are marked *

GET LATEST NEWS AND TIPS

  • Yes, please, I agree to receiving my personal Plesk Newsletter! WebPros International GmbH and other WebPros group companies may store and process the data I provide for the purpose of delivering the newsletter according to the WebPros Privacy Policy. In order to tailor its offerings to me, Plesk may further use additional information like usage and behavior data (Profiling). I can unsubscribe from the newsletter at any time by sending an email to [email protected] or use the unsubscribe link in any of the newsletters.

  • Hidden
  • Hidden
  • Hidden
  • Hidden
  • Hidden
  • Hidden

Related Posts

Knowledge Base

Plesk uses LiveChat system (3rd party).

By proceeding below, I hereby agree to use LiveChat as an external third party technology. This may involve a transfer of my personal data (e.g. IP Address) to third parties in- or outside of Europe. For more information, please see our Privacy Policy.