Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
litespeed_wiki:cache:no-plugin-concrete5 [2018/07/11 14:29]
Lisa Clarke Proofreading and Additional Content
litespeed_wiki:cache:no-plugin-concrete5 [2020/09/17 19:50] (current)
Lisa Clarke Redirect to new Documentation Site
Line 1: Line 1:
-====== LSCache + Concrete5 ====== +~~REDIRECT>​https://​docs-stage.ls.com/20200902-lscache/lscache/​noplugin/​settings/​~~
-LSCache, similar to Varnish cache, is a simpler and more efficient page caching solution built-in to LiteSpeed Web Server. When used in conjunction with Concrete5, you can expect significant performance gains with a quick and easy setup. Cache management is also made significantly easier and more flexible. +
- +
-Below are some recommended configurations to enable LSCache and get it working with your Concrete5 installation. +
- +
-===== Configure Server/​Virtual Host Level Cache Root And Cache Policy ===== +
- +
-Server/​VirtualHost level cache storage needs to be configured properly for your environment. Select your server setup from the **Web Server Configuration** section of our [[litespeed_wiki:​cache:​common_installation#​web_server_configuration|LiteSpeed Cache Installation Guide]] and follow the instructions to set the server/​virtual host level cache root and cache policy. +
- +
-===== Requirements ===== +
-Install Concrete5 on a domain or a subdomain, and then create a new admin subdomain. Both domains must use the same document root. +
- +
-==== Why? ==== +
-Caching a Concrete5 site can be tricky, because there is no admin directory. As such, when you cache the site for visitors, //you are also caching it for admin functions and development//​. This is not ideal. +
- +
-One solution is to define a subdomain that you can use when you want to do administrative tasks. Configure the subdomain to use the same document root as the main site's domain (i.e. ''​public_html''​),​ and then exclude it from caching in ''​.htaccess''​. This essentially gives you two different ways of accessing the exact same site. To view the cached content, you would access the site at ''<​nowiki>www.domain.com</​nowiki>'',​ and to do admin work, you would access the uncached content at ''<​nowiki>​admin.domain.com</​nowiki>''​. They point to the same location, except one is cached and one is not. +
- +
-For more about this concept, please see [[https://www.madesimplemedia.co.uk/​blog/​run-litespeed-cache-with-concrete5|the blog post by madesimplemedia]]. +
- +
-===== Rewrite rules ===== +
-Activate cache for the main domain with: +
- +
-<​code>​RewriteEngine On +
-RewriteCond %{REQUEST_METHOD} ^HEAD|GET$ +
-RewriteCond %{HTTP_HOST} ^domain.com [NC] [OR] +
-RewriteCond %{HTTP_HOST} ^www.domain.com [NC] +
-RewriteRule .* - [E=Cache-Control:​max-age=120]<​/code> +
- +
-After that, exclude the subdomain that we will use for administration with: +
-<​code>​RewriteCond %{REQUEST_METHOD} ^HEAD|GET$ +
-RewriteCond %{HTTP_HOST} ^admin.domain.com$ [NC] +
-RewriteRule .* - [E=Cache-Control:​no-cache]</code> +
- +
-===== Verify Cache Setup ===== +
-Please make sure you can see the ''​X-LiteSpeed-Cache:​ hit''​ header by following [[litespeed_wiki:​cache:​no-plugin-setup-guidline#​verify_that_pages_are_served_from_the_cache|this wiki]]. Note that you will see a cache hit only for the main domain as the admin subdomain is excluded. +
- +
-===== Deleting Outdated Cache Files Using A Cron Job ===== +
-Please refer to [[litespeed_wiki:​cache:​no-plugin-setup-guidline#​deleting_outdated_cache_files_using_a_cron_job|this wiki]]. +
- +
-===== Notes ===== +
-  * Because of the way you set up the main domain and admin domain, it is better for SEO if you disable Google and other robots from indexing the admin domain. Otherwise, your SEO will be penalized because of duplicate content. +
-  * If you have problems accessing the subdomain, please check the code in your ''​.htaccess''​ file.+
  • Admin
  • Last modified: 2018/07/11 14:29
  • by Lisa Clarke