XenForo LiteSpeed Cache [Deleted]

I installed this on one of the XF forums and it started causing issues on a vb forum where users were being logged but it shows them logged on with someone else name. I uninstalled the add-on and disabled litespeed cache and problem went away on vb forum.
 
I don't know if this is a litespeed cache problem, or just something else, but here we go. Whenever I sign out, I have to refresh the page in order for it to recognize I singed out. Any ideas?

EDIT: Yeah, it does seem to be a problem with this. Any idea on how to fix it?
 
Last edited:
@Slavik Any update on users getting logged out when visiting the site again? Having a new client ( @NixFifty ) users reporting this happening. Hasn't been happening to any other clients, but saw others have reported this already. I just added XenForo_Helper_Cookie::setCookie(XenForo_Application::getOptions()->litespeedcache_cookiename, true); to global.php but no word back yet if helping. I can't reproduce this myself and from the user reports on the site, appears to be happening mostly on mobile and chrome.
 
  • Like
Reactions: Naz
@Slavik Any update on users getting logged out when visiting the site again? Having a new client ( @NixFifty ) users reporting this happening. Hasn't been happening to any other clients, but saw others have reported this already. I just added XenForo_Helper_Cookie::setCookie(XenForo_Application::getOptions()->litespeedcache_cookiename, true); to global.php but no word back yet if helping. I can't reproduce this myself and from the user reports on the site, appears to be happening mostly on mobile and chrome.

Ive been hard pressed to reproduce any issues myself, unfortunately I dont think there is anything else we can do (as we use no-cache headers for logged in pages and the cookie for detection).

Maybe @lswave has some additional ideas?
 
Any updates with this? Unfortunately the plugin is unusable for us. Users who choose to "stay logged in" are logged out after closing their browser and visiting the site again. When they try to login, they receive a security error. It clears up once they empty cache and cookies. We've attempted with PHP 5.5 + OPcache, Xcache, as well as Memcache. The issue also exists without any frontend or backend caching at all. We also tried the plugin modifications lswave provided in previous posts. None of this has worked for us so far.
 
Hey Mike,

Any issues with the main index page not showing the users logged when they open up their browser again? (as soon as my users click any other link, it shows them as logged in, just not on the main forum page)

This is, of course, assuming you are using this resource as well.

Have you found solution? I have the same problem.
 
One thing i notice:
On the example page here: http://www.litespeedtech.com/support/forum/threads/general-guideline-to-use-litespeed-cache.4719/
Litespeed cache rewrite rules placed after application's rewrite rules
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php

# this part is for public cache.
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{HTTP_COOKIE} !loginuser
RewriteCond %{ORG_REQ_URI} !^/index.php$
RewriteCond %{ORG_REQ_URI} !^/administrator/
RewriteCond %{ORG_REQ_URI} (\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule .* - [E=Cache-Control:max-age=300,L]


But if i do this with Xenforo, cache wont work.
So i had to move Litespeed cache rewrite rules placed before application's rewrite rules. This way, cache function working. But i have problem as many have, users not logged in on Forum Home page.
Code:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{HTTP_COOKIE} !loggedin
RewriteRule .* - [E=Cache-Control:max-age=300]

<IfModule mod_rewrite.c>
        RewriteEngine On

        #       If you are having problems with the rewrite rules, remove the "#" from the
        #       line that begins "RewriteBase" below. You will also have to change the path
        #       of the rewrite to reflect the path to your XenForo installation.
        #RewriteBase /xenforo

        #       This line may be needed to enable WebDAV editing with PHP as a CGI.
        #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -l [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^.*$ - [NC,L]
        RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
        RewriteRule ^.*$ index.php [NC,L]
</IfModule>
 
If you site is big, with lot of guest, this litespeed cache can reduce your server load by at least 1/2 to 1/3
Thanks! I will give a try then. How does it differ from OpCache? I don't need all technical details; just want to be aware what does it do that the opcache won't?
 
opCache caches code. LS Cache, serves cache of whole or partial pages. It basically generates a page 1 time and then serves it up to all your guests. To put it simply: if you have 1000 guests requesting the page, then instead of 1000 requests for all queries and elements, its just 1 request. i.e. you lower your database strain by factor 1000.
 
Top Bottom