We've enable litespeed cache on a living vB seo site successfully, the load dropped a lot during peak time, response has become faster.
vBulletin 4.1.2
vBSEO 3.6.0
litespeed 4.0.20
1. the cache plugin for vBulletin 3/4
save above code as litespeed_cache.xml, and using
vBulletin Admin Control Panel(/admincp)->
Plugins & Products->
Add/Import Product
to import above .xml.
2.rewrite rule in vBulletin's home directory .htaccess
#VBSEO -- original vbseo rules
....
RewriteRule ^(.+)$ vbseo.php [L,QSA]
===>
RewriteRule ^(.+)$ vbseo.php [QSA]
#rules for litespeed cache:
RewriteCond %{HTTP_COOKIE} !vbseo_loggedin=yes
RewriteCond %{HTTP_COOKIE} !bb_userid=
RewriteCond %{HTTP_COOKIE} !bb_password=
#RewriteCond %{ORG_REQ_URI} ^/(index\.php|)$
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{QUERY_STRING} ^$
RewriteRule (.*) - [L,E=Cache-Control:max-age=60]
note:
1. in fact nothing new here, just put all pieces together to make it simple
2. the vBulletin plugin is based on the vB plugin for varnish as we always mentioned in past posts/blog.
Boosting vBulletin Performance with Advanced Caching,the attached file product-boostv1.xml
vBulletin 4.1.2
vBSEO 3.6.0
litespeed 4.0.20
1. the cache plugin for vBulletin 3/4
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<product productid="lswscache" active="1">
<title>Litespeed Caching</title>
<description>settings to make Litespeed page cache working right</description>
<version>1.0</version>
<url />
<versioncheckurl />
<dependencies>
</dependencies>
<codes>
</codes>
<templates>
</templates>
<plugins>
<plugin active="1" executionorder="1">
<title>Unset session id for guest users</title>
<hookname>global_start</hookname>
<phpcode><![CDATA[if($vbulletin->userinfo['userid'] <= 0)
{
$vbulletin->session->vars['sessionurl'] = '';
$vbulletin->session->vars['sessionurl_q'] = '';
}]]></phpcode>
</plugin>
<plugin active="1" executionorder="1">
<title>SET COOKIE FOR LOGGED IN USERS</title>
<hookname>login_verify_success</hookname>
<phpcode><![CDATA[if ($send_cookies AND $cookieuser)
{
// Cookie user
vbsetcookie('imloggedin', 'yes', true, true, true);
}
else
{
// Not permanent
vbsetcookie('imloggedin', 'yes', false, true, true);
}]]></phpcode>
</plugin>
<plugin active="1" executionorder="1">
<title>Send X-LiteSpeed-Cache-Control header for logged in users</title>
<hookname>style_fetch</hookname>
<phpcode><![CDATA[// Do not cache logged in user pages
if ( $vbulletin->userinfo['userid'] )
{
header('X-LiteSpeed-Cache-Control: no-cache');
};]]></phpcode>
</plugin>
</plugins>
<phrases>
</phrases>
<options>
</options>
<helptopics>
</helptopics>
<cronentries>
</cronentries>
<faqentries>
</faqentries>
</product>
vBulletin Admin Control Panel(/admincp)->
Plugins & Products->
Add/Import Product
to import above .xml.
2.rewrite rule in vBulletin's home directory .htaccess
#VBSEO -- original vbseo rules
....
RewriteRule ^(.+)$ vbseo.php [L,QSA]
===>
RewriteRule ^(.+)$ vbseo.php [QSA]
#rules for litespeed cache:
RewriteCond %{HTTP_COOKIE} !vbseo_loggedin=yes
RewriteCond %{HTTP_COOKIE} !bb_userid=
RewriteCond %{HTTP_COOKIE} !bb_password=
#RewriteCond %{ORG_REQ_URI} ^/(index\.php|)$
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{QUERY_STRING} ^$
RewriteRule (.*) - [L,E=Cache-Control:max-age=60]
note:
1. in fact nothing new here, just put all pieces together to make it simple
2. the vBulletin plugin is based on the vB plugin for varnish as we always mentioned in past posts/blog.
Boosting vBulletin Performance with Advanced Caching,the attached file product-boostv1.xml
Last edited: