Differences

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

Link to this comparison view

Next revision
Previous revision
litespeed_wiki:litespeed:cache:joomla [2012/01/19 01:06]
127.0.0.1 external edit
litespeed_wiki:litespeed:cache:joomla [2015/07/27 15:54] (current)
Michael Alegre
Line 11: Line 11:
 ===== LiteSpeed Caching ===== ===== LiteSpeed Caching =====
  
-LiteSpeed webserver (LSWS) cache bypasses php invocation and serves cached page directly from LSWS cache. Hence a much bigger performance improvement can be achieved.+LiteSpeed webserver (LSWS) cache bypasses php invocation and serves cached page directly from LSCache. Hence a much bigger performance improvement can be achieved.
  
 ==== Joomla Code Change ==== ==== Joomla Code Change ====
  
-To work with Joomla (cached for either guest visitor or logged-in user), ​LSWS cache relies on a cookie token to differentiate whether a user is logged in or not. However, Joomla assigns cookie to any user (guest and logged-in). cookie value changes as same session go through different stage (such as before login, after login, logout and log back in, etc) while cookie key stays the same. The easy way is the create desired cookie in joomla by modifying its code (small modification in login/​logout stage). Login/​Logout functions are located in the standard user component (docroot/​component/​com_user/​controller.php).+To work with Joomla (cached for either guest visitor or logged-in user), ​LSCache ​relies on a cookie token to differentiate whether a user is logged in or not. However, Joomla assigns cookie to any user (guest and logged-in). cookie value changes as same session go through different stage (such as before login, after login, logout and log back in, etc) while cookie key stays the same. The easy way is the create desired cookie in joomla by modifying its code (small modification in login/​logout stage). Login/​Logout functions are located in the standard user component (docroot/​component/​com_user/​controller.php).
  
 The modification is as follows: The modification is as follows:
Line 43: Line 43:
 </​code>​ </​code>​
  
-Once test ok, implement rewrite rules to enable ​LSWS cache for the resources that required caching.+Once test ok, implement rewrite rules to enable ​LSCache ​for the resources that required caching.
  
 ==== Rewrite rules for LSWS caching ==== ==== Rewrite rules for LSWS caching ====
Line 78: Line 78:
 ########## End - Joomla! core SEF Section ########## End - Joomla! core SEF Section
  
-########## Begin - Rules for LSWS cache+########## Begin - Rules for LSCache
 RewriteCond %{REQUEST_METHOD} ^HEAD|GET$ RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
 RewriteCond %{HTTP_COOKIE} !loginuser RewriteCond %{HTTP_COOKIE} !loginuser
Line 85: Line 85:
 RewriteCond %{ORG_REQ_URI} (\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/​[^.]*)$ ​ [NC] RewriteCond %{ORG_REQ_URI} (\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/​[^.]*)$ ​ [NC]
 RewriteRule .* - [E=Cache-Control:​max-age=300,​L] RewriteRule .* - [E=Cache-Control:​max-age=300,​L]
-########## End - Rules for LSWS cache+########## End - Rules for LSCache
 </​code>​ </​code>​
  
Line 98: Line 98:
   - /​administrator/​* is the Joomla backend. No need to be cached.   - /​administrator/​* is the Joomla backend. No need to be cached.
  
-LSWS Cache Policy configuration (Admin Console -> Server/​Vhost ->​Cache->​ Cache Policy).+LSCache ​Policy configuration (Admin Console -> Server/​Vhost ->​Cache->​ Cache Policy).
  
-==== LSWS Cache Policies ====+==== LSCache ​Policies ====
  
 Cache Policy: Cache Policy:
Line 114: Line 114:
   Private Cache Expire Time (seconds): ​ => 120   Private Cache Expire Time (seconds): ​ => 120
  
-To verify if a resource is served out of LSWS cache is simple, just look for "​X-LiteSpeed-Cache:​ hit,​private"​ in server response header. If the header is present, the resource IS served from LSWS cache.+To verify if a resource is served out of LSCache ​is simple, just look for "​X-LiteSpeed-Cache:​ hit,​private"​ in server response header. If the header is present, the resource IS served from LSCache.
  
   HTTP/1.1 200 OK   HTTP/1.1 200 OK
  • Admin
  • Last modified: 2015/07/27 15:54
  • (external edit)