LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > LiteSpeed Cache > Litespeed cache + vB + vBSEO conflicts/issues ?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2011, 04:24 PM
eva2000 eva2000 is offline
Senior Member
 
Join Date: Dec 2004
Location: Brisbane, Australia
Posts: 142
Post Litespeed cache + vB + vBSEO conflicts/issues ?

Thanks to Mert over at vBSEO, I 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

Code:
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]
Varnish plugin stripping guests of session id/hash

PHP Code:
if($vbulletin->userinfo['userid'] <= 0)
{
$vbulletin->session->vars['sessionurl']  = '';
$vbulletin->session->vars['sessionurl_q']  = '';

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.

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
Reply With Quote
  #2  
Old 01-30-2011, 04:47 PM
eva2000 eva2000 is offline
Senior Member
 
Join Date: Dec 2004
Location: Brisbane, Australia
Posts: 142
NiteWave 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 &#37;{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]
Reply With Quote
  #3  
Old 01-31-2011, 08:41 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,585
The expire time of cookie "vbseo_loggedin" is set to 1 second earlier than the current time, maybe it is intended to remove that cookie, not to send it back to web server as request cookie.

If that is the case, just test if "vbseo_loggedin" presents, if it does, user logged in, no cache, if it does not, cache the page.
Reply With Quote
  #4  
Old 02-05-2011, 08:51 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
I overlooked this post... so following may works:
Quote:
# 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
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{QUERY_STRING} ^$
RewriteRule (.*) - [L,E=Cache-Control:max-age=120]
Reply With Quote
  #5  
Old 02-06-2011, 01:54 PM
eva2000 eva2000 is offline
Senior Member
 
Join Date: Dec 2004
Location: Brisbane, Australia
Posts: 142
Thanks i think this is same as the code you set me last time (that didn't work right). Will test this again
Reply With Quote
  #6  
Old 02-06-2011, 04:37 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,218
there is only 1 but important difference:

RewriteCond %{HTTP_COOKIE} vbseo_loggedin=deleted
changed to
RewriteCond %{HTTP_COOKIE} !vbseo_loggedin
Reply With Quote
  #7  
Old 02-14-2011, 07:07 PM
bhanuprasad1981 bhanuprasad1981 is offline
Senior Member
 
Join Date: Apr 2009
Posts: 160
hi eva have you really got any working .htaccess for vbseo+litespeed combination?
Reply With Quote
  #8  
Old 02-16-2011, 12:48 PM
eva2000 eva2000 is offline
Senior Member
 
Join Date: Dec 2004
Location: Brisbane, Australia
Posts: 142
not yet, been a bit busy lately but will get back to testing soon

Quote:
Originally Posted by NiteWave View Post
there is only 1 but important difference:

RewriteCond %{HTTP_COOKIE} vbseo_loggedin=deleted
changed to
RewriteCond %{HTTP_COOKIE} !vbseo_loggedin
Thanks .. will try later on... been a bit busy :o
Reply With Quote
  #9  
Old 02-16-2011, 09:20 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,585
Based on my investigation on this, the latest ruleset should work, however, there are a few URLs need to be excluded like "/login/wait", so the cache related rules are
Code:
#%LiteSpeed Cache rules 
RewriteCond %{HTTP_COOKIE} !vbseo_loggedin
RewriteCond %{ORG_REQ_URL} !(login/wait|admincp|(login|register|usercp|private|profile|cron|image)\.php))
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{QUERY_STRING} ^$
RewriteRule (.*) - [L,E=Cache-Control:max-age=120]
Reply With Quote
  #10  
Old 02-17-2011, 07:10 PM
bhanuprasad1981 bhanuprasad1981 is offline
Senior Member
 
Join Date: Apr 2009
Posts: 160
so these rules should be added along with vbseo normal rules ?
Reply With Quote
Reply

Tags
cookies, litespeed cache, vbseo, vbulletin

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:52 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.