CacheWall Information

We have recently implemented a feature named "CacheWall" on all of our shared servers. This knowledgebase aims to explain what it is, how it works, and how you can obtain the most from this feature.

What is CacheWall?
CacheWall is essentially a Varnish cache server placed in front of Apache. Its purpose is to cache content on your website(s) to improve performance, decrease loading times and to reduce resource usage.

How does it work?
When a request is made to your website, traditionally Apache will accept the request, retrieve the content and then serve it back to the visitor. For dynamic content (such as PHP pages) which contain code, this code needs to be processed and executed each and every time the PHP page is accessed. Processing this code takes time and server resources, which can introduce minor delays when waiting for a page to load.

In a huge majority of cases, a PHP page will return the same content or result when accessed, only very infrequently returning a different response or result. Think of a Wordpress blog, for example. When someone visits your blog, PHP runs in the background and checks for new posts and then displays these posts to the user. The act of invoking the PHP thread, parsing the code, calculating the result and then displaying it to the user may take a second or two. If you only update your blog once a day, then having PHP constantly processing code and consuming resources is rather wasteful. Instead, we can implement a cache which will save a copy of the result of your blog and save it to the server's RAM. This means that next time someone accesses your blog, instead of having PHP parse the code and perform its calculations, we can just serve the already saved page directly to the user. The result? The website loads faster and uses less resources.

Please note that the above is a very rough illustration and example of how the caching process works. There are additional variables that come into play, and we will try and outline some of these in this KB article.

Because cached content is loaded from RAM and not from a disk, benchmarks also show that loading static files/content from Varnish can be significantly faster than Apache alone, too.

Stale Cache
A "stale cache" is a term that describes a situation where the cache on the server is out of date and no longer reflects the content that should be displayed. An example of this (referring to our previous example) is when you make a new blog post but when visiting your site this blog post is not displayed. The reason for this is that the cache has not yet updated and is "stale", or "out of date". Another situation may be that you are making changes to your website and have updated an image or file, but the server is not showing these changes. This is because the cache has not yet updated and the result is that the previous file/content is being shown.

There are situations where this may occur during normal website maintenance, but fortunately we provide tools and workarounds for this problem. These will be detailed later on within this knowledgebase article.

How long is content cached for?
Different types of content are cached for different periods of time. The idea is that static files (such as images, CSS, Javascript, etc) generally do not change very often so can be cached for greater periods of time. PHP pages, for example, are intended to serve dynamic content so we consider these pages as needing a much shorter cache period. By default, we implement the following cache durations:

PHP and other dynamic files: 60 seconds (1 minute)
Static files: 1800 seconds (30 minutes)

I am performing maintenance on my website and I need the cache temporarily disabled, how do I do this?
We understand that caching can cause conflicts when trying to perform maintenance on your website, and there are situations where you need to ensure that caching is disabled when working on your site. Fortunately we provide an easy way to achieve this through cPanel. Simply login to cPanel and click on the "CacheWall" icon under the 'Software' section:



Within the CacheWall page, find the domain name you wish to temporarily disable CacheWall on and click the 'Enable Development Mode' button to the right:



Enabling development mode will disable CacheWall on this domain name for a period of 3 hours, at which time it will then automatically re-enable. This should provide you with enough time to work on your website without experiencing any stale cache issues.

There are parts of my website that I do not ever want cached, such as a backend/login system, a forum, or an RSS feed. How do I disable CacheWall on this content?
By default, our Varnish installation will never cache any content that sends a "Cache-control: no cache" HTTP header. This is inaccordance with the HTTP specification which states that when this header is present, no content should ever be cached. Such headers are typically used in many systems that contain login areas or other dynamic-heavy code. If for any reason you are experiencing caching on a section of your website(s) that you believe should not be cached, please contact our support team via our client area and provide the URL to the appropriate areas and we will set up an exception on the server for you. For security reasons, it is not possible for users to create exceptions themselves from within cPanel.

I do not want any of my website(s) cached! How do I disable CacheWall?
We strongly do not recommend disabling CacheWall on an entire account or domain name, as the benefits it provides are significant and will help to improve your website performance. If you are experiencing issues, please get in touch with us and we will work with you to resolve anything that may be cache related. That said, if you do wish to completely disable CacheWall, then simply login to cPanel and click on the "CacheWall" icon under the 'Software' section:



Locate the domain name you wish to disable caching on and then click the 'On' button to toggle the cache off:

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What are the specs of your shared hosting servers?

Our shared servers contain a minimum of 8 Cores (Dual x Quad Core CPU's) and 4GB RAM.

What is a reseller account? Aren't addon domains good enough?

"Addon Domains" within Cpanel allow you to host additional domains from a single hosting account....

How do I access my hosting control panel?

We provide WHM/Cpanel access to all of our clients. To access your control panel, simply navigate...

How do I use my hosting control panel?

At ThisWebHost we currently implement the WHM/Cpanel control panel for our customers to use. We...

What happens if I exceed my bandwidth or disk space?

Bandwidth Due to the way our systems are configured, you are "hard limited" to the amount of...