Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:cache:no-plugin-joomla [2018/03/21 13:35]
Jackson Zhang [LSCache + Joomla (<3.x) Configuration]
litespeed_wiki:cache:no-plugin-joomla [2020/09/17 19:49] (current)
Lisa Clarke Redirect to new Documentation Site
Line 1: Line 1:
-====== LSCache + Joomla (<3.x) Configuration ====== +~~REDIRECT>https://docs-stage.ls.com/20200902-lscache/lscache/noplugin/settings/~~
- +
-**NOTE: [[litespeed_wiki:​cache:​lscjoomla|There is a module now]]. If you are running Joomla 3.x or later, please use the module. If you are running Joomla 2.x or lower, you can still use the rewrite rule based lscache as instructed in this wiki. ** +
- +
-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 Joomla, you can expect significant performance gains with a quick and easy setup. Cache management is also made significantly easier and more flexible. While the LiteSpeed cache plugin for Joomla is still in development,​ rewrite rules can still be used to customize LSCache'​s behavior. +
- +
-Below are some recommended configurations to enable LSCache and get it working with your Joomla site(s). +
- +
-===== 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. +
- +
-===== Rewrite rules ===== +
- +
-Rewrite rules should be added to your .htaccess file, located in the document root of your website, right before the following line: +
-   +
-  ## Begin - Joomla! core SEF Section. +
- +
-==== Case 1: Cache all URLs for 2 mins excluding ''/​administrator''​ URLs ==== +
-  ########## Begin - Litespeed cache +
-  <​IfModule LiteSpeed> +
-    RewriteEngine On +
-    CacheDisable public / +
-    RewriteCond %{REQUEST_METHOD} ^HEAD|GET$ +
-    RewriteCond %{ORG_REQ_URI} !/​administrator +
-    RewriteRule .* - [E=Cache-Control:max-age=120] +
-  </IfModule>​ +
-  ########## End - Litespeed cache +
-  +
-**Note:​** ​ The ''​CacheDisable public ​/''​ directive is used to help protect against globally enabled caching and is optional. Instead, the server'​s global cache settings should be checked to ensure that cache is not enabled globally.  +
- +
-**Note:** Do not use ''​CacheEnable public /''​ here as it will enable caching for all URLs belonging to this virtual host, including admin pages. +
- +
-==== Case 2: Caching all URLs except those specified ==== +
- +
-  ########## Begin Litespeed cache +
-  <​IfModule LiteSpeed>​ +
-    RewriteEngine On +
-    CacheEnable public / +
-    RewriteCond %{REQUEST_METHOD} ^HEAD|GET$ +
-    RewriteCond %{ORG_REQ_URI} /​administrator/​ +
-    RewriteRule ​.* - [E=Cache-Control:​no-cache] +
-  </​IfModule>​ +
-  ########## End - Litespeed cache +
-   +
-==== Case 3: Caching URLs for specified domains only ==== +
- +
-  ########## Begin - Litespeed cache +
-  <​IfModule LiteSpeed>​ +
-   ​RewriteEngine On +
-   ​RewriteCond %{REQUEST_METHOD} ^HEAD|GET$ +
-   ​RewriteCond %{HTTP_HOST} ^domain.com [NC] [OR] +
-   ​RewriteCond %{HTTP_HOST} ^www.domain.com [NC] +
-   ​RewriteCond %{ORG_REQ_URI} !/administrator +
-   ​RewriteRule .* [E=Cache-Control:​max-age=120] +
-  </IfModule>​ +
- +
-**Note:** We recommend using a different domain for your backend so that you can add/edit/preview a website'​s content through the admin domain without worrying about these changes being cached and seen by visitors. For example: admin.domain.com for admin users, domain.com and www.domain.com for the general public. You can specify which domain to be cached, such as domain.com and www.domain.com,​ so that admin.domain.com won't be cached. ​  +
- +
-===== Verify Cache Setup ===== +
- +
-Please verify to see if you can see "​X-LiteSpeed-Cache:​ hit" by following [[litespeed_wiki:​cache:​no-plugin-setup-guidline#​verify_that_pages_are_served_from_the_cache|this wiki]]. +
- +
-===== 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]].+
  • Admin
  • Last modified: 2018/03/21 13:35
  • by Jackson Zhang