This article describes how to enable caching on a Turbo Boost or Turbo Max Web Hosting account.
By default, caching is disabled on Turbo Boost and Turbo Max Web Hosting accounts. To enable caching for your account, you use directives in an .htaccess file. These directives enable you to control precisely which types of content the Turbo Boost or Turbo Max Web Hosting server caches, and for how long. You should create the .htaccess file in the base folder for the application that you want to cache.
The following sample configuration demonstrates how to enable caching on a Turbo Boost or Turbo Max Web Hosting account:
<IfModule LiteSpeed>
CacheEnable public
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^GET|HEAD$
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteCond %{REQUEST_URI} !login|admin|register|post|cron
RewriteCond %{QUERY_STRING} !nocache
RewriteRule .* - [E=Cache-Control:max-age=300]
</IfModule>
RewriteCond %{HTTP_HOST} ^example.com|example.net|example.org [NC]
Let's go through this example configuration line by line:
To verify that caching is working correctly on your account, you can examine the raw HTTP headers sent between the browser and web server. (To do this, use a browser plugin that displays the raw headers such as Live HTTP headers for Mozilla Firefox, or the Developer Tools feature in Google Chrome.) When content is served from the cache, the server adds the following line to the HTTP response header:
X-LiteSpeed-Cache: hit
If you do not see this line in the HTTP response header from the server, then the content was not served from the cache.
For detailed information about caching behavior on a server running LiteSpeed, please visit http://www.litespeedtech.com/support/wiki/doku.php?id=litespeed_wiki:litespeed:cache.
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.