LiteSpeed Cache for XF2 - Community

LiteSpeed Cache for XF2 - Community 2.3.0

No permission to download
Here is an interesting bug:

I reset an accounts password and am redirected to the home page, from here I'm given a static cached version, A hard refresh does not update nor clear. I view certain forums or threads and I am logged back in to that account but going back to the homepage presents the guest cached version. To work around this, I can access a logged in forum / thread post password change (same session) and log out from there and log back in directly from the homepage.

Video:
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.

(email is sent via amazon ses / tracked)
 
Here is an interesting bug:

I reset an accounts password and am redirected to the home page, from here I'm given a static cached version, A hard refresh does not update nor clear. I view certain forums or threads and I am logged back in to that account but going back to the homepage presents the guest cached version. To work around this, I can access a logged in forum / thread post password change (same session) and log out from there and log back in directly from the homepage.

Video:
To view this content we will need your consent to set third party cookies.
For more detailed information, see our cookies page.

(email is sent via amazon ses / tracked)
That is an interesting one, I'll look into reproducing this behavior locally today.

Thanks for the report,
-Michael
 
That is an interesting one, I'll look into reproducing this behavior locally today.

Thanks for the report,
-Michael

For me I can now 100% confirm it was the caching that caused this issue. I disabled the primary rewrite rules on placed in htaccess, replaced it with the "RewriteRule (.*) - [E=Cache-Control:no-cache]" string and made sure the headers showed no hit and then began another reset. This time it worked, no static cached content and I was directly logged in without having to go to non cached pages.

Hopefully you can replicate this.
 
For me I can now 100% confirm it was the caching that caused this issue. I disabled the primary rewrite rules on placed in htaccess, replaced it with the "RewriteRule (.*) - [E=Cache-Control:no-cache]" string and made sure the headers showed no hit and then began another reset. This time it worked, no static cached content and I was directly logged in without having to go to non cached pages.

Hopefully you can replicate this.

Hello again @MentaL ,

I agree that it does appear to be a cache issue from your video and description but so far I am unable to reproduce locally. I am resetting my admin account's password from index.php?account/security (a "no-cache "page) but on reset I do not get redirected to the home page so I am not seeing this behavior at all.

Perhaps I am misunderstanding who the password reset is for or how you are performing the reset. If you'd like to DM me with more information we can hopefully get this one figured out.

Regards,
-Michael
 
Michael A. updated LiteSpeed Cache for XF2 - Community with a new update entry:

LiteSpeed Cache Plugin for XF2 v2.3.0

[Improvement] Added "lost password confirm" as a do-not-cache page.
[Improvement] Misc code improvements.
[Bug Fix] Logged-in cookie is now cleared when a visitor is logged-out due to a session timeout.
[Bug Fix] Visitors automatically logged-in from the "forgot my password" submission page are now correctly detected as non-guest visitors.

Read the rest of this update entry...
 
Which plugin only needs to be activated or does it need to be configured?
I can't find anywhere how to configure it.
 
Ok I have to add this manually in hataccess.
You should write it in the plugin description because it's not intuitive.

# LiteSpeed XenForo cache
<IfModule litespeed>
CacheLookup public on
RewriteEngine On
# cache
RewriteCond %{HTTP_COOKIE} !(xf_lscxf_logged_in|xf_user|xf_session_admin) [NC]
RewriteCond %{REQUEST_URI} !/install/ [NC]
RewriteRule .* - [E=Cache-Control:max-age=360,E="cache-vary:xf_style_id,xf_language_id"]
# no cache
RewriteCond %{HTTP_COOKIE} (xf_lscxf_logged_in|xf_user|xf_session_admin) [NC]
RewriteRule .* - [E=Cache-Control:vary=loggedin,E=Cache-Control:no-cache]
</IfModule>
 
Last edited:
Looks like the code here is not written correctly:

LiteSpeedCache/ XF/ ControllerPlugin/Login.php

Code:
class Login extends XFCP_Login
{
    /**
     *
     * @noinspection PhpUnused
     */
    public function completeLogin( User $user, $remember )
    {
        if ( $user->user_id !== XF::visitor()->user_id ) {
            /**
             * Set custom cookie to better track logged in state when
             * "Stay logged in" is unchecked.
             */
            XF::app()->response()
            ->setCookie(LscListener::LOGGED_IN_COOKIE_NAME, 1)
            ;
        }

        /** @noinspection PhpUndefinedClassInspection */
        parent::completeLogin($user, $remember);
    }

}

public function completeLogin( User $user, $remember )
should be
public function completeLogin( $user, $remember )

It was causing problems with another add-on
 
Looks like the code here is not written correctly:

LiteSpeedCache/ XF/ ControllerPlugin/Login.php

Code:
class Login extends XFCP_Login
{
    /**
     *
     * @noinspection PhpUnused
     */
    public function completeLogin( User $user, $remember )
    {
        if ( $user->user_id !== XF::visitor()->user_id ) {
            /**
             * Set custom cookie to better track logged in state when
             * "Stay logged in" is unchecked.
             */
            XF::app()->response()
            ->setCookie(LscListener::LOGGED_IN_COOKIE_NAME, 1)
            ;
        }

        /** @noinspection PhpUndefinedClassInspection */
        parent::completeLogin($user, $remember);
    }

}


should be


It was causing problems with another add-on
I don't think so its this addon doing it wrong. Your other addon need an update.
 
Top Bottom