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:webadc [2017/10/30 16:15]
Jackson Zhang
litespeed_wiki:cache:webadc [2020/11/18 15:36] (current)
Lisa Clarke Redirect to new Documentation Site
Line 1: Line 1:
-====== LSCache + LiteSpeed WebADC ====== +~~REDIRECT>https://docs.litespeedtech.com/products/lsadc/cache/~~
- +
-To enable cache on ADC, you will need to setup server-level cache root, virtual host level of cache root, and enable cache in the virtual host cache settings. ​ On back-end web server, you will need to install litespeed cache plugin such as litespped cache plugin for wordpress or litemage plugin for magento etc. If there is no cache plugin available for that application yet, you can use rewrite rule to enable cache on virtual host setting of ADC. +
- +
-===== Enable Cache on ADC with plugin on Backend web server ===== +
-Enable cache on ADC through backend cache plugin is the recommended way since it is super easy for you to configure. Backend cache plugin has already managed the most situations for you automatically,​ without manually configuring rewrite rules.  +
- +
-The following explains how to enable cache on LiteSpeed WebADC to communicate with WordPress, Magento, or other web apps that use an LSCache plugin via the following structure: ​ LiteSpeed WebADC (With Cache) ​Back end web server > WordPress Application +
- +
-==== Set Server level cache root on Web ADC ==== +
-  * Navigate to **LSLB Web Admin Console→Server→Cache** +
-    - Set **Storage Path** to ''/​home/​lscache/''​  +
-{{:litespeed_wiki:​cache:​adc-server.png?​|}} +
- +
-==== Set virtual host level cache root on Web ADC ==== +
- ​Navigate to **LSLB Web Admin Console→Virtual Hosts→Cache**,​ Set **Storage Path** to ''​/home/Litespeed443/​lscache''​ +
- +
-==== Enable cache on ADC ==== +
-  * Set **Check Public Cache** to ''​Yes''​ +
-{{:​litespeed_wiki:​cache:​adc-vh.png?|}} +
- +
-==== Install and activate litespeed cache plugin on backend web server ==== +
-  * Install and activate plugin for WordPress at backend web servers by following this [[litespeed_wiki:​cache:​lscwp:​installation#​installation|Installation article]] +
- +
-''​Note 1'':​ The above steps are for most applications other than MagentoYou will need to install Litespeed cache plugin for that application at back end server, which is recommended way.  If there is no plugin available at this time, you can setup cache on ADC through rewrite rules on each virtual host. +
- +
-''​Note 2'':​ For Magento, you will need to set "​Enable LiteMage"​ to "​yes"​ on ADC and install LiteMage plugin at the backend of web servers. +
- +
-===== Enable Cache on ADC without plugin on Backend web server ===== +
- +
-If the LiteSpeed cache plugin is still not available, or you still prefer to use rewrite rules to control the cache on ADC instead of backend web server, you can enable it on ADC through rewrite rules under virtual host/​context. The advantage of this will be centralized the cache management on ADC, the disadvantage of this is far fewer situations the rewrite rules can handle than cache plugin and no universal rules to fit everything. Also for different backend applications,​ you will need to set different rules to fit the requirement of that application.  +
- +
-The rewrite rules are similar to LSWS and you can check here for [[litespeed_wiki:​cache:​no-plugin-setup-guidline|examples and details]]. +
- +
-The following will give you an example on how to enable cache for Joomla. +
- +
-The first three steps will be same as above for server level cache root setup, virtual host level cache root setup and enable cache on ADC setting. The difference is the fourth step: configure rewite rules on ADC virtual host instead of installing cache plugin on backend web server. +
- +
-==== Set Server level cache root on Web ADC ==== +
-  * Navigate to **LSLB Web Admin Console→Server→Cache** +
-    - Set **Storage Path** to ''/​home/​lscache/''​  +
-{{:​litespeed_wiki:​cache:​adc-server.png?​|}} +
- +
-==== Set virtual host level cache root on Web ADC ==== +
- ​Navigate to **LSLB Web Admin Console→Virtual Hosts→Cache**,​ Set **Storage Path** to ''/​home/​Litespeed443/​lscache''​ +
- +
-==== Enable cache setting on ADC ==== +
-  * Set **Check Public Cache** to ''​Yes''​ +
-{{:​litespeed_wiki:​cache:​adc-vh.png?​|}} +
- +
-==== Set rewrite rules to make cache working ==== +
-Set rewrite rules under rewrite tab(make sure rewrite is enabled in the setting): +
- +
-  RewriteCond %{REQUEST_URI} ^.*\.(jpg|css|js|gif|png|svg)$ [NC] +
-  RewriteRule .* - [E=Cache-Control:​no-cache] +
-  RewriteRule ^/(solutions|error-page|products) - [E=Cache-Control:​max-age=120] +
-   +
-{{ :​litespeed_wiki:​cache:​adc-cache-rewrite-example.png?​600 |}} +
-     +
-The above is only an example. You can set rules according to your need.  +
-You can also create some contexts if required and set rules there. +
- +
-===== Testing ===== +
- +
-You can check if a page is being cached from WebADC by:  +
-    - Navigating to your site from a non-logged-in browser and using your browser'​s developer tools to check the response header. +
-    - Enter the URL ''<​nowiki>​http:​//[Back_end_web_server_IP]/​[wordpress-path]</​nowiki>''​ and check that there is no cache from response header. +
-    - Enter the URL ''<​nowiki>​http:​//​[Web_ADC_IP]/​[wordpress-path]</​nowiki>''​. Reload the page and look for ''​X-LiteSpeed-Cache:​ hit''​ in the response headers. If it's there, then the page is being served by the cache. +
-    - Modify a post with the WordPress application,​ then press Ctrl+F5 to refresh ''<​nowiki>​http://​[Web_ADC_IP]/​[wordpress-path]</​nowiki>'',​ you should see the updated posts. ​  +
- +
-===== Turning On the Web ADC Debug Log ===== +
-To turn on the Web ADC Debug Log, you would follow the exact same steps that are laid-out [[litespeed_wiki:​config:​toggle-debug-logging|here]] for LiteSpeed Web Server. +
  • Admin
  • Last modified: 2017/10/30 16:15
  • by Jackson Zhang