How do I use NGINX server-based caching to speed up my website?
Our bundled, unbundled and WordPress hosting plans include NGINX, a high-performance proxy server which sits between your website and its visitors. This system allows us to offer you server-based caching which could speed up your website with one click.
It's a powerful addition to our hosting facilities. However, before you switch on NGINX caching for your site, be aware of the security risks because some sites aren't suitable for it and could show private data in the wrong places.
What is website page caching?
Many websites are "dynamic", with each page being put together in real-time as it is requested by the site's visitor. This is true for sites using online content management or e-commerce systems such as WordPress, Drupal, Joomla and Magento. Without going into too much detail, website page caching is a way of speeding up a website, particularly a dynamic one, by storing copies of pre-built pages and sending these "finished products" to website visitors instead.
What are the benefits of website page caching?
Dynamic websites which utilise page caching tend to be served faster to visitors, giving a boost to performance for site visitors and in many cases delivering better statistics on performance testing tools.
What are some things to bear in mind about website page caching?
Once a page has been cached, that version of the page will be served to website visitors until the cache is refreshed. On our hosting, this is around once per hour. This is fine for pages which do not get updated very often but if you are updating a page frequently - such as with articles or discussion forums - it can take a while for visitors to be able to see the latest version of the page.
Also, caching does not benefit content which is different for each visitor, such as logged in users' accounts and shopping basket content. There is no point in the cache storing the content because it will be "wrong" for the next user.
What do I need to know before enabling caching?
- The potential security risk: if your website is not configured correctly, it might end up showing personal data to the wrong person. For example, the "my account" page, order history page, shopping basket and - depending on your site - even more sensitive data could be shown to the wrong user or even the general public without logging in. Most modern websites using WordPress/WooCommerce, Magento etc will differentiate correctly between content suitable and not suitable for caching but be prepared to check your site carefully after enabling NGINX caching, to make sure that no private data is being leaked in this way.
- Think about potential issues with double caching: if you already have page caching facilities within your website - such as through a WordPress plugin - you might encounter issues if your pages are cached twice (once within WordPress and once on the web server side). If you're not sure, use one or the other.
- It's on a per-account basis: if you have multiple sites within the same hosting account, NGINX is enabled for all or none of them - there is no in-between option.
How do I enable or disable NGINX caching on my Enbecom hosting plan?
Log in to your web hosting control panel (cPanel). There is a guide on how to log in to cPanel for Enbecom clients on this Knowledgebase page.
Within cPanel, in the right hand column (on desktop/laptop/tablet cPanel) there is a simple switch to enable or disable NGINX Caching:
How do I clear my hosting plan's NGINX cache?
Directly underneath the NGINX switch is a Clear Cache button to force the cache to be cleared. Your web pages will temporarily load more slowly, as the cache builds up again through website visits.
Do you offer custom NGINX configurations?
On our bundled, unbundled and WordPress specific hosting plans, your site might be sharing resources with sites belonging to other clients. Also, we want to keep the NGINX setup on these plans as simple to use as possible. For these reasons, we do not offer the ability to customise your hosting account's NGINX setup beyond switching caching on and off and clearing the cache. That said, a VPS (virtual private server) from our Enbeservers range provides you with full access to configure services such as NGINX how you wish.