Caching

how-tos
Monday August 21, 2023
Web Hosting - Caching

Table of Contents

Before proceeding with this mini-guide, it is assumed that you have already set up and have a functional Virtual Host. If you haven't done so, please consult the Virtual Host or Quick Start guides for detailed information.

Memcached and Nginx caching play pivotal roles in optimizing website performance and enhancing user experience.

Memcached is an in-memory caching system that significantly reduces database load and speeds up website response times. By storing frequently accessed data in memory, Memcached minimizes the need for repetitive database queries, resulting in faster page loading and reduced server load. This leads to improved scalability and enhanced overall website performance, particularly for dynamic websites that heavily rely on database interactions.

Nginx caching, on the other hand, acts as a reverse proxy server, caching static content and pages. By serving cached content directly to users, Nginx reduces the workload on the backend server, resulting in quicker response times and improved server efficiency. Nginx caching is particularly beneficial for handling high traffic volumes and delivering static content efficiently, which is crucial for modern websites with multimedia assets and resources.

Together, Memcached and Nginx caching contribute to a more responsive, scalable, and faster website, providing visitors with a seamless browsing experience and allowing websites to handle increased traffic without sacrificing performance. Their strategic implementation is essential for optimizing resource-intensive websites and ensuring smooth, efficient content delivery to users worldwide.

Memcached

To set up Memcached, it is recommended to consult with your web application vendor for specific guidance. For CMS systems like WordPress or Drupal, installing a caching plugin can handle memory caching automatically. Regardless of the approach, you will need to acquire your connection socket information. This can be easily obtained by navigating to "Caching" > "Memcached" in your control panel, allowing you to seamlessly configure Memcached and optimize your website's performance.

Web Hosting - Memcached Setup
Memcached Setup

NGINX

Navigate to "Caching" > "NGINX" to get started.

At Hostney, we offer static content and dynamic page caching through NGINX. For WordPress sites, you can safely enable this caching engine as our system is preconfigured to exclude caching of content for signed-in users, shopping carts, and more.

If you use a custom-built website engine or other CMS systems, fine-tuning your caching settings becomes essential to ensure that only necessary content is cached. To achieve this, navigate to the "Global Exclusions" option, where you can exclude specific cookies and URLs from being cached.

Please note that each cookie name and URL should be on separate lines, and leaving blank lines in the form is not allowed. The provided cookie names and URLs will exclude all instances that include them. For instance, if you provide the cookie name "mysite," the system will exclude any cookies containing "mysite" in the name.

Similarly, URL exclusions work in a similar manner. If you need to exclude everything under www.example.com/myadminpanel/, simply add a line with "/myadminpanel" to exclude it from caching. This level of customization allows you to optimize caching based on your specific website requirements, ensuring smooth performance and efficient resource utilization.

It's important to note that these caching settings are account-wide. You don't need to configure each website individually under the same Hostney account. Once set, the caching exclusions will apply to all websites associated with your account, streamlining the process and providing consistent caching behavior across your hosting environment.

Web Hosting - NGINX Caching Exclusions
NGINX Caching Exclusions

Finally, with just one click, you can easily enable caching for your website. This streamlined process allows you to quickly optimize your website's performance and take advantage of the benefits of caching without any complex configurations or settings.

By default, the cache time is set to 4 hours, ensuring that your website benefits from efficient caching while also allowing for timely updates to the cached content.

Web Hosting - NGINX Caching
NGINX Caching
Continue Reading

Join a growing community of thousands of developers and designers!

What will you build today?

Create an account