vBulletin Guest Cache with LiteSpeed

Discussion in 'LiteSpeed Cache' started by dihuta, Oct 22, 2010.

  1. track1

    track1 New Member

    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: Feb 4, 2011
  2. NiteWave

    NiteWave Administrator

    it's rather strange. the cache should reduce php/mysql load a lot.
  3. track1

    track1 New Member

    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: Feb 11, 2011
  4. NiteWave

    NiteWave Administrator

    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?
  5. track1

    track1 New Member

    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.
  6. track1

    track1 New Member

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

    webizen New Member

    Is this plugin used in every page (php request)? If not, then it can not be used as lsws needs a signature for (non)cacheable page.
  8. bhanuprasad1981

    bhanuprasad1981 New Member

    any sucess with vbseo installed site s? i have used this on two sites on my server sucessfully , but major big 3 sites use vbseo so really minimal impact i see :(
  9. mistwang

    mistwang LiteSpeed Staff

  10. mistwang

    mistwang LiteSpeed Staff

    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.
  11. track1

    track1 New Member

    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: Feb 24, 2011
  12. eva2000

    eva2000 Member

    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>
  13. dihuta

    dihuta Member

    It's is working now with VB+VBSEO but there is an error showing sometimes when I open my website:

    This error may come from ajax.
    Could you please help?
    Thanks.
  14. mistwang

    mistwang LiteSpeed Staff

    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.
  15. dihuta

    dihuta Member


    Here is the rewrite rulte:

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

Share This Page