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/31 18:10]
Jackson Zhang [Testing]
litespeed_wiki:cache:webadc [2018/05/15 13:30] (current)
Jackson Zhang [Enable Cache on ADC]
Line 20: Line 20:
   * Set **Check Public Cache** to ''​Yes''​   * Set **Check Public Cache** to ''​Yes''​
 {{:​litespeed_wiki:​cache:​adc-vh.png?​|}} {{:​litespeed_wiki:​cache:​adc-vh.png?​|}}
 +  * **Check Private cache** normally leave it as blank at most of the cases. Set it to ''​Yes''​ only if there is a private ESI block. ​
 ==== Install and Activate LiteSpeed Cache Plugin on Backend Web Server ==== ==== Install and Activate LiteSpeed Cache Plugin on Backend Web Server ====
 Install and activate your plugin according to that plugin'​s directions: Install and activate your plugin according to that plugin'​s directions:
Line 55: Line 55:
   * Set **Check Public Cache** to ''​Yes''​   * Set **Check Public Cache** to ''​Yes''​
 {{:​litespeed_wiki:​cache:​adc-vh.png?​|}} {{:​litespeed_wiki:​cache:​adc-vh.png?​|}}
 +  * **Check Private cache** normally leave it as blank at most of the cases. Set it to ''​Yes''​ only if there is a private ESI block. ​
 ==== Set Rewrite Rules to Configure Cache ==== ==== Set Rewrite Rules to Configure Cache ====
 Set rewrite rules under rewrite tab (make sure rewrite is enabled in the settings): Set rewrite rules under rewrite tab (make sure rewrite is enabled in the settings):
Line 70: Line 70:
 ===== Testing ===== ===== Testing =====
  
-You can check if a page is being cached from WebADC ​by: +You can check if a WordPress ​page is being cached from Web ADC by: 
     - Navigating to your site from a non-logged-in browser and using your browser'​s developer tools to check the response header.     - 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://​[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.     - 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. ​  +    - 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. ​  
-    ​- ​Will I see "​Cache-Control:​max-age"​ header"​ when I use lscache? ​The answer is No. Please be aware there are two different concepts: ''​Cache-Control:​max-age''​ is regular cache response header which controls the cache behavior of a browser or public proxy, not lscache ​from the server side.  ​while ''​[E=cache-control:​max-age=120]''​ is to control LiteSpeed internal server cache and won't affect browser cache ''​Cache-Control:​max-age''​. Our cache engine won't insert regular client/​browser ''​Cache-Control''​ header because it is not desired to let browser or proxy to cache the content ​while the original server completely lost controlIf the content has been updatedthere is no way to purge those cached ​content. ​Only cache it at origin, the server can purge stale content reliably at any time, the client ​will see updated content immediately+ 
-    ​- ​''​x-litespeed-cache-control''​ is on our ADC to do list.  +==== Will I see "​Cache-Control:​max-age"​ header"​ when I use lscache? ​==== 
-    ​- ​If there is still any need to let browser ​to cache the content, you can configure backend to insert regular "​Cache-Control"​ headers.+No. Please be aware there are two different concepts: ''​Cache-Control:​max-age''​ is regular cache response header which controls the cache behavior of a browser or public proxy, ​//not// LSCache ​from the server side.  ​While ''​[E=cache-control:​max-age=120]''​ is to control LiteSpeed'​s ​internal server cache and //won't// affect browser cache. ​ 
 +Our cache engine won't insert ​the regular client/​browser ''​Cache-Control''​ header because it is not desired to let the browser or proxy cache the dynamic ​content. ​This would remove cache control from the serverand if LSCache ​no longer has control, it will be unable ​to purge updated ​content. ​As a result, the browser ​will serve out-of-date pages
 +  
 +''​x-litespeed-cache-control''​ is on our ADC to do list.  
 + 
 +If there is still need to let the browser cache content, you can configure ​the backend to insert regular "​Cache-Control"​ headers.
        
 {{ :​litespeed_wiki:​cache:​adc-cache-rewrite-max-control-header.png?​600 |}} {{ :​litespeed_wiki:​cache:​adc-cache-rewrite-max-control-header.png?​600 |}}
  • Admin
  • Last modified: 2017/10/31 18:10
  • by Jackson Zhang