This is a discussion on Help to solve conflit between Litespeed guests cache + VBSEO within the General Discussion forums, part of the vBSEO SEO Plugin category; Originally Posted by GeorgeL Interesting, I tried litespeed cache on wordpress 3.0.4 with permalinks enabled via mod_rewrite and wordpress pages ...
Mert Gökçeimam / Crawlability Inc.
vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!
Twitter:@Depkac
Personal Blog : Mert Gökçeimam
Interestingly, we have tested this code and it doesn't work at all. We have also tried just turning on the file cache in LiteSpeed. It works great for some time, but then it starts sending out infinite loop redirects over port 80. Some browsers will pick up on this error, and certainly search engine bots and things like the W3C Validator and Pingdom will. This is bad news. I can only assume this is due to the default rewrite rules in .htaccess for VBSEO not being interpreted correctly, or in a more strict format, when the file cache is enabled. The speed improvement is quite impressive, but I see no way to get it to work long-term. LiteSpeed does live up to its name, for so long as you have the RAM or disk space, you can handle tens of thousands of concurrent connections vs. apache.
Hi Mike
Thanks to Mert got a test license installed on local server, from what I can see, this is what is happening. vBulletin varnish xml plugin has extra code to assign custom cookies to members and guests (session prefix + imgloggedin yes) and also code to strip guest visitors of the session id/hash so that varnish will cache guests without cookies. Litespeed cache's .htaccess tries to match these plugin cookies so you're telling litespeed cache to cache php pages where imloggedin=yes isn't set and where userid/password cookie isn't set.
default litespeed cache .htaccess i am using
Varnish plugin stripping guests of session id/hashCode:RewriteCond %{HTTP_COOKIE} !zzimloggedin=yes RewriteCond %{HTTP_COOKIE} !zzuserid= RewriteCond %{HTTP_COOKIE} !zzpassword= RewriteCond %{REQUEST_METHOD} ^HEAD|GET$ RewriteCond %{QUERY_STRING} !s=[a-fA-F0-9]{32} RewriteCond %{QUERY_STRING} !product=vbnexus RewriteCond %{REQUEST_URI} !^(login|register|usercp|private|profile|cron|image)\.php$ RewriteCond %{REQUEST_URI} !^admincp RewriteRule ^(.*\.php)?$ - [L,E=Cache-Control:max-age=300]
Now what is happening is when vbseo is enabled, it seems to be reintroducing the guest visitors session id/hash into the cookies for guests.PHP Code:if($vbulletin->userinfo['userid'] <= 0)
{
$vbulletin->session->vars['sessionurl'] = '';
$vbulletin->session->vars['sessionurl_q'] = '';
}
vBSEO Disabled
This is what i see with vbseo disabled, only zzlastactivity and zzlastvisit cookies are set when varnish plugin enabled as it strips sessionid/hash.
Header for vBSEO disabled with varnish plugin enabled
vBSEO Enabled
Now when you enable vbseo, session id/hash for guests is reintroduced along with vbseo_loggedin=yes/deleted for members/guests, which in theory if you used varnish cache (in apache+varnish setup), varnish wouldn't cache the vbseo page as it has cookies vbseo_loggedin so varnish vcl would need adjusting. But it doesn't explain why litespeed cache isn't caching the page other than proper detection of vbseo_loggedin cookie in htaccess ?
Header when vBSEO enabled with Varnish plugin enabled
litespeed htaccess might need additional for guests caching somewhere ?
Code:RewriteCond %{HTTP_COOKIE} vbseo_loggedin=deleted![]()
NiteWave from litespeed asked me to try this htaccess for vBSEO + litespeed cache, while it works to allow vBSEO to function, litespeed isn't caching the pages
Code:# Comment the following line (add '#' at the beginning) # to disable mod_rewrite functions. # Please note: you still need to disable the hack in # the vBSEO control panel to stop url rewrites. RewriteEngine On # Some servers require the Rewritebase directive to be # enabled (remove '#' at the beginning to activate) # Please note: when enabled, you must include the path # to your root vB folder (i.e. RewriteBase /forums/) #RewriteBase / #RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com #RewriteRule (.*) http://www.yourdomain.com/forums/$1 [L,R=301] RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L] RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap) RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/ RewriteRule ^(.+)$ vbseo.php [QSA] RewriteCond %{HTTP_COOKIE} vbseo_loggedin=deleted RewriteCond %{REQUEST_METHOD} ^HEAD|GET$ RewriteCond %{QUERY_STRING} ^$ RewriteRule (.*) - [L,E=Cache-Control:max-age=120]
So what was the final configuration that made this work correctly? Still using product-boostv1.xml?
With help of VBSEO Staff,
We made it working fine now. Please use this for your htaccess
### VBSEO
RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap)
RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ vbseo.php [QSA]
RewriteCond %{HTTP_COOKIE} !vbseo_loggedin=yes
RewriteCond %{HTTP_COOKIE} !mobile_device
RewriteCond %{HTTP_COOKIE} !bb_userid=
RewriteCond %{HTTP_COOKIE} !bb_password=
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{QUERY_STRING} ^$
RewriteRule (.*) - [L,E=Cache-Control:max-age=120]
dihuta - I've tried every different configuration and I still can't get the cache working correctly. I placed the rules above after vbseo and the cache doesn't appear to be working. When I look in the litespeed stats there is a 0 under cache hits.
a Litespeed staff modified my Varnish Mod for vBulletin.
I attach here that modified Mod which I'm using.
Be sure to set cache folder for Litespeed Cache to properly created folder.
yep, I have a very similar plugin installed. I also have the disk cache folder setup in litespeed.
The only way I get anything to work is if I put the rules before the vbseo rules, but then I just get errors all over the place.
If it sill can not work, you should contact a litespeed staff for help.