![]() |
[Solved] LiteSpeed Cache + Joomla
Joomla is a fairly populate content management system (CMS). It is a common sense that most Web sites have content that does not change frequently should use caching techniques to reduce load to server and improve end user experience. Joomla itself has three levels of caching:
1. Page caching 2. View caching 3. Module caching Page caching is the one that significantly improves performance (8 times faster). However, the cache result (in html format) is saved as a php file in docroot/cache/page directory. IOW, php is still invoked to serve these pages. 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. To work with Joomla (cached for guest visitor only), 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). The modification is as follows: Code:
function login() {Code:
function logout ()In file joomla_docroot/.htaccess Code:
########## Begin - Joomla! core SEF SectionCode:
########## Begin - Joomla! core SEF Section1. Only cache for Head or Get requests 2. Cache for guest user (no loginuser cookie) 3. Cache request to any URLs like ((\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$) but excluding /index.php, and /administrator/* 4. Cache for 300 seconds Note: 1. Joomla's login form (index.php) is not cache friendly (contain a security token) and has to be excluded from being cached. 2. /administrator/* is the Joomla backend. No need to be cached. LSWS Cache Policy configuration (Admin Console -> Server/Vhost ->Cache-> Cache Policy). Cache Policy: Quote:
Quote:
Following is the ab benchmark of the test sites in our lab against latest Joomla 1.5 (1.5.22) with sample data comes with install. Litespeed Cache + Joomla 1.5.22 (with NO system cache plugin) Code:
Code:
Code:
Benchmarking 192.168.0.56 (be patient).....done |
Modification of core files
A joomla 1.5 and 1.7 (2.5) plugin for this would be awesome... so that core files did not need to be manipulated.
|
Does this include the new private cache for individual users?
|
Quote:
|
Perhaps an update then?
|
no problem. will do.
|
Joomla Plugin
Seriously... about the plugin... Joomla guys would go nuts if a decent caching mechanism were setup. Litespeed would start getting demanded by Joomla designers.
I'd recommend the guy at http://www.nonumber.nl/ help you write it... or http://www.joomlaworks.gr |
Thanks for the info. will update the guide first and go from there.
|
I wonder why I always get
ip@ip:~/Desktop/hs$ curl -I http://some.dk HTTP/1.1 200 OK Date: Fri, 09 Nov 2012 11:36:53 GMT Server: LiteSpeed Connection: close X-Powered-By: PHP/5.3.16 P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM" Set-Cookie: ba5120434de25501685872454c829084=rt2d7if5vp2uioent 3o7cee112; path=/ Set-Cookie: ja_opal_tpl=ja_opal; expires=Wed, 30-Oct-2013 11:36:49 GMT; path=/ Content-Type: text/html; charset=utf-8 Expires: Mon, 1 Jan 2001 00:00:00 GMT Last-Modified: Fri, 09 Nov 2012 11:36:53 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Did I miss something in configuration? Enable Cache No Cache Expire Time (seconds) 300 Cache Request with Query String Yes Cache Request with Cookie Yes Cache Response with Cookie Yes Ignore Request Cache-Control Yes Ignore Response Cache-Control Yes Enable Private Cache Yes Private Cache Expire Time (seconds) 300 Max Keep-Alive Requests 100 Smart Keep-Alive Yes Keep-Alive Timeout (secs) 5 |
make sure the cache storage settings are set and Storage Path is writable by web user.
Quote:
|
| All times are GMT -7. The time now is 03:13 AM. |