XenForo LiteSpeed Cache [Deleted]

I think I have a more reliable solution. Just shooting it over to @ExtraLicense now for his thoughts.

Why can't we just change that :
Code:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{HTTP_COOKIE} !skipPageCache
RewriteRule .* - [E=Cache-Control:max-age=60,L]

To that :
Code:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{HTTP_COOKIE} !xf_user
RewriteRule .* - [E=Cache-Control:max-age=60,L]

? If there isn't the cookie xf_user, then we cache the content.
 
Why can't we just change that :
Code:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{HTTP_COOKIE} !skipPageCache
RewriteRule .* - [E=Cache-Control:max-age=60,L]

To that :
Code:
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{HTTP_COOKIE} !xf_user
RewriteRule .* - [E=Cache-Control:max-age=60,L]

? If there isn't the cookie xf_user, then we cache the content.
this cookie is set ONLY, if "Stay logged in" was activated.


Please wait for slaviks update, we've found a much better solution:)
 
Slavik updated XenForo LiteSpeed Cache with a new update entry:

1.1.0 Release

Contains a variety of improvements.
  1. No longer logs users out on install
  2. Allows alteration of the cookie name if desired
  3. Adds a no-cache header responce to prevent logged in users accidentally generating logged-in cached files for guests.
  4. Improved .htaccess rules to be more re-write friendly when used with other rules.

Code:
<IfModule litespeed>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{HTTP_COOKIE} !skipPageCache
RewriteRule .* - [E=Cache-Control:max-age=60]
</IfModule>

Read the rest of this update entry...
 
Ok, it's working as excepted :)

But there is a kind of bug, when I add the .htaccess lines, everyone are getting logged out. Then, they log in back and it looks fine, the problem is that the skipCache cookie is stored as a session (and not a traditional cookie), so each time the member close the browser, and get back to my site, he needs to log in back in order to stop seing the guest's cached view.

An other example, I am using this addon : http://xenforo.com/community/resources/just-in-time-reigstration.2689/, and if the user register using this way he is then redirected to the index. The problem is that he is logged out.
 
Ok, it's working as excepted :)

But there is a kind of bug, when I add the .htaccess lines, everyone are getting logged out. Then, they log in back and it looks fine, the problem is that the skipCache cookie is stored as a session (and not a traditional cookie), so each time the member close the browser, and get back to my site, he needs to log in back in order to stop seing the guest's cached view.

An other example, I am using this addon : http://xenforo.com/community/resources/just-in-time-reigstration.2689/, and if the user register using this way he is then redirected to the index. The problem is that he is logged out.

When using this addon you need to be aware of any side effects of caching pages may have. Addons like that, will yes have issues as the user is not logged in.
 
Ok, it's working as excepted :)

But there is a kind of bug, when I add the .htaccess lines, everyone are getting logged out. Then, they log in back and it looks fine, the problem is that the skipCache cookie is stored as a session (and not a traditional cookie), so each time the member close the browser, and get back to my site, he needs to log in back in order to stop seing the guest's cached view.
It was intentional that the cookie is a session cookie (no lifetime).

There's no way to get the real session lifetime http://xenforo.com/community/threads/getter-for-xenforo_session-_config.65877/ (i've found a way)
One could say that it is hardcoded in XenForo_Session, BUT it doesn't mean that it's 3300 for everybody http://xenforo.com/community/threads/online-status-timeout.56686/#post-605772 .. ;)
That's why i prefered to not use the hardcoded value for the cookie lifetime.
 
Last edited by a moderator:
When using this addon you need to be aware of any side effects of caching pages may have. Addons like that, will yes have issues as the user is not logged in.

Don't take care of my example, that's not the real problem.

It was intentional that the cookie is a session cookie (no lifetime).

There's no way to get the real session lifetime http://xenforo.com/community/threads/getter-for-xenforo_session-_config.65877/ (i've found a way)
One could say that it is hardcoded in XenForo_Session, BUT it doesn't mean that it's 3300 for everybody http://xenforo.com/community/threads/online-status-timeout.56686/#post-605772 .. ;)
That's why i prefered to not use the hardcoded value for the cookie lifetime.

The problem is that once the addon is active, users are getting disconnected. They can log in back then, but each time they close their browser, they need to log in back.

It's working great between (without this bug) !
 
Don't take care of my example, that's not the real problem.



The problem is that once the addon is active, users are getting disconnected. They can log in back then, but each time they close their browser, they need to log in back.

It's working great between (without this bug) !

I can't replicate this error im afraid.

To be honest given your other problem you mentioned previously, it sounds like you have something else interfering.
 
I can't replicate this error im afraid.

To be honest given your other problem you mentioned previously, it sounds like you have something else interfering.

Ok I'll check if there isn't any conflict.

BTW, to reproduce :
  1. Make sure you don't have the skipCache cookie.
  2. Enable the addon (via htaccess).
  3. Refresh.
 
Ok I'll check if there isn't any conflict.

BTW, to reproduce :
  1. Make sure you don't have the skipCache cookie.
  2. Enable the addon (via htaccess).
  3. Refresh.

Nope, still can't reproduce this.
 
Last edited:
Nope, still can't reproduce this.

I'm having an other problem ^^

I'm actually using debug mode as a guest (the debug mode is only for my IP), but because of the cache anyone can see it then (they can't access the details, but can see the line at the bottom).

It's not a bug since it's how any cache would work, but would you have an idea to fix it server side ? Would Litespeed private cache make the work ?
 
Last edited:
I'm having an other problem ^^

I'm actually using debug mode as a guest (the debug mode is only for my IP), but because of the cache anyone can see it then (they can't access the details, but can see the line at the bottom).

It's not a bug since it's how any cache would work, but would you have an idea to fix it server side ? Would Litespeed private cache make the work ?

This addon is very young;)
I'm having several improvement ideas, but because i don't have litespeed, i need some time to get familiar with it!(I didn't know that it exists before slavik contacted us :D)

It's also too expensive, to get it only for the development purpose;)
 
Last edited by a moderator:
I'm having an other problem ^^

I'm actually using debug mode as a guest (the debug mode is only for my IP), but because of the cache anyone can see it then (they can't access the details, but can see the line at the bottom).

It's not a bug since it's how any cache would work, but would you have an idea to fix it server side ? Would Litespeed private cache make the work ?

You shouldnt be using debug mode regardless on a live board, even if it is IP limited, you should only enable it when its needed, so, this wouldn't realy warrent looking at...
 
Top Bottom