vBulletin Guest Cache with LiteSpeed

track1

Well-Known Member
#41
I'm testing this feature in a real environment (high traffic vb3 forum), and seems to work well. The level of load on the servers is similar to apache/no-cache but supports many more simultaneous requests without overloading, tested with AB.

For now, I found some problems with 503 errors (not cache related) that are already solved, and at peak times, for some unknown reason, there was an overload of the database server that had not happened before, so I had to go back to apache.

Continue testing, I have 3 active trial licenses will buy if it goes well.
 
Last edited:

track1

Well-Known Member
#43
I have made more intensive tests with litespeed and adding some tuning work as stable as Apache and allow more connections. Finally bought 3 enterprise licenses.

One problem with cache system/vbulletin:
- Cache system works ok, but sometimes store pages of logged-in users and displays to guest users.

My .htaccess is as follows, checking everything (cookie values, etc) is correct, i don't know how that can happen sometimes.

Code:
RewriteEngine on
RewriteCond %{HTTP_COOKIE} !bbimloggedin=yes
RewriteCond %{HTTP_COOKIE} !bbuserid=
RewriteCond %{HTTP_COOKIE} !bbpassword=
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{QUERY_STRING} !s=[a-fA-F0-9]{32}
RewriteCond %{REQUEST_URI} !^/forum/(login|register|usercp|private|profile|cron|image)\.php$
RewriteRule (.*) - [L,E=Cache-Control:max-age=120]
 
Last edited:
#44
maybe this line
RewriteCond %{REQUEST_URI} !^/forum/(login|register|usercp|private|profile|cron|image)\.php$
not correct for your site?

what's the forum homepage? domain.com/ or domain.com/forum/?

p.s. what's status of the special mysql issue you mentioned last time?
 

track1

Well-Known Member
#45
that line and path is correct on site .htaccess (some disallowed php files to be cached rule).

Reported logged in-cached pages are sometimes for showthread.php?t=xxxxx

mysql issue was probably some puntual overload, it has not happened again. Everything is working very stable and fast.
 

track1

Well-Known Member
#46
this plugin have any usage with litespeed?
Code:
// Do not cache logged in user pages
if ( $vbulletin->userinfo['userid'] )
{
        header('X-Accel-Expires: 0');
};
 

mistwang

LiteSpeed Staff
#50
this plugin have any usage with litespeed?
Code:
// Do not cache logged in user pages
if ( $vbulletin->userinfo['userid'] )
{
        header('X-Accel-Expires: 0');
};
with LSWS 4.0.20, change header() code or add a new one

Code:
header('X-LiteSpeed-Cache-Control: no-cache' );
it will prevent LSWS from caching this page.
 

track1

Well-Known Member
#51
with LSWS 4.0.20, change header() code or add a new one

Code:
header('X-LiteSpeed-Cache-Control: no-cache' );
it will prevent LSWS from caching this page.
ok great, just upgraded to 4.0.20 and changed that header.

Haven't found why sometimes .htaccess rules were not respected, but i hope with this, any logged user page will be cached and server to not logged in users.
 
Last edited:

eva2000

Well-Known Member
#52
Thanks for thank NiteWave reminded me you'd have to enable the plugin for it to work so plugin active from 0 to 1 - see http://vbtechsupport.com/127/

so from

PHP:
		<plugin active="0" executionorder="1">
			<title>Send X-Accel-Expires 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-Accel-Expires: 0');
};]]></phpcode>
		</plugin>
to
PHP:
		<plugin active="1" executionorder="1">
			<title>Send X-Accel-Expires 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>
 

dihuta

Well-Known Member
#53
It's is working now with VB+VBSEO but there is an error showing sometimes when I open my website:

Your submission could not be processed because you have logged in since the previous page was loaded, please reload the windows.
This error may come from ajax.
Could you please help?
Thanks.
 

mistwang

LiteSpeed Staff
#54
Maybe cached some page should not be cached.
The error is related to a security token from my google result.
what rewrite rule and code patch are you using?
Does a reload fix it?
check the response header "x-litespeed-cache: hit" see if you get a cached page, for login user, should not get any cached page.
 

dihuta

Well-Known Member
#55
Maybe cached some page should not be cached.
The error is related to a security token from my google result.
what rewrite rule and code patch are you using?
Does a reload fix it?
check the response header "x-litespeed-cache: hit" see if you get a cached page, for login user, should not get any cached page.

Here is the rewrite rulte:
RewriteCond %{HTTP_COOKIE} !vbseo_loggedin
RewriteCond %{ORG_REQ_URI} !(login/wait|admincp|phpmyadmin|modcp|uploader|(login|register|usercp|private|profile|cron|image|index_vbgallery)\.php)
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{QUERY_STRING} ^$
RewriteRule (.*) - [L,E=Cache-Control:max-age=300]

Reload can fix it. This issue happen when we re-visit the forum after a time.
 
Last edited:
Top