LSCache For vBulletin?

Discussion in 'vBulletin Forum' started by Deepblue, Jan 19, 2017.

  1. Deepblue

    Deepblue Member

    Hello,

    Is there any way to make LSCashe compatible with vBulletin?

    I've found and article from LSBlog but it was a very old article and seems outdated because i've failed to success though i followed all the necessary steps correct.

    Thanks in advance.
    Best Regards.
     
  2. NiteWave

    NiteWave Administrator

    Deepblue likes this.
  3. Deepblue

    Deepblue Member

    litespeed_cache.xml imported through admincp, content of the plugin:

    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>
    Litespeed Cache Settings:

    [​IMG]

    .htaccess rules:

    [​IMG]

    And the result:

    [​IMG]
     
  4. NiteWave

    NiteWave Administrator

    the rewrite rule may need adjust to fit your forum.
    for example, cookie prefix may not be "bb_"
    you can PM me the URL of the forum, so I can get more info to be able to suggest more.
     

Share This Page