LiteSpeed Cache for XF2 - Community

LiteSpeed Cache for XF2 - Community 2.3.0

No permission to download
Michael, for the wordpress plugin, do we still need to follow the beta install procedure (export settings etc), or can we just straight hit the upgrade button?

I'm not 100% on this. I've been trying to follow along with the decisions being made on our side but it's all still a little confusing to me. I do know that v3 is not live yet in the WordPress repo so my answer would be yes, most likely.

You'd probably get a better answer by asking in the #wpcache channel on our public slack.

Regards,
-Michael
 
Are there any configuration settings for the plugin? I have it enabled with the .htaccess settings in your documentation but I don't see anywhere where I can customize any settings for the cache.
 
Are there any configuration settings for the plugin? I have it enabled with the .htaccess settings in your documentation but I don't see anywhere where I can customize any settings for the cache.

Not currently. The plugin acts as a simple add-on to inform LiteSpeed Web Server to cache guest pages for some amount of time.

E=Cache-Control:max-age=360 in the .htaccess rules can be modified to change the amount of time in seconds a page is cached if you'd like.

Regards,
-Michael
 
Has anyone had an issue with this addon and @Siropu Ads Manager 2?

LS Cache/addon seemed to be working fine, confirmed by hits noted in header and general website function.

One problem I noticed is that Ads Manager 2 was not showing the correct ads (for example showing ads restricted to desktop/tablet users to those on mobile devices) or not showing ads at all to visitors. Once I logged in, all ads appeared correctly on all devices.

If I disable the LS Cache plugin and comment out the htaccess code, it also works correctly for logged in/out and mobile/desktop.

On my previous host without Litespeed (using PHP-FPM and memcached), Ads Manager 2 also worked correctly in all instances.

Any suggestions appreciated.
 
Has anyone had an issue with this addon and @Siropu Ads Manager 2?

LS Cache/addon seemed to be working fine, confirmed by hits noted in header and general website function.

One problem I noticed is that Ads Manager 2 was not showing the correct ads (for example showing ads restricted to desktop/tablet users to those on mobile devices) or not showing ads at all to visitors. Once I logged in, all ads appeared correctly on all devices.

If I disable the LS Cache plugin and comment out the htaccess code, it also works correctly for logged in/out and mobile/desktop.

On my previous host without Litespeed (using PHP-FPM and memcached), Ads Manager 2 also worked correctly in all instances.

Any suggestions appreciated.

Howdy @carsafety,

It sounds like you need to add a cache vary for mobile views to your .htaccess rules. We have a wiki page explaining this here: https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:developer_guide:cache-vary
 
Howdy @carsafety,

It sounds like you need to add a cache vary for mobile views to your .htaccess rules. We have a wiki page explaining this here: https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:developer_guide:cache-vary

This is way over my pay grade lol. Is this something that has to be done in Xenforo, Siropu or LS Cache addon code by a developer, or something done only in htaccess? If the latter, is there a copy/paste code that I could try, if so is it one of the examples provided and where do I put it? That's about the extent of my ability:-(
 
This is way over my pay grade lol. Is this something that has to be done in Xenforo, Siropu or LS Cache addon code by a developer, or something done only in htaccess? If the latter, is there a copy/paste code that I could try, if so is it one of the examples provided and where do I put it? That's about the extent of my ability:-(

It should be pretty simple, you just need to set a vary if your in mobile view through the .htaccess rules.

You can try adding
Apache config:
RewriteCond %{HTTP_USER_AGENT} "iPhone|iPod|BlackBerry|Palm|Mobile|Opera Mini|Fennec|Windows Phone"
RewriteRule .* - [E=Cache-Control:vary=ismobile]

Right after
Code:
RewriteEngine On

in the existing .htaccess rules for the plugin.
 
Thank you very much! To be clear so I don't brick my website, these two lines go within the IfModule litespeed section, just below the RewriteEngine line of code, and just above the # cache comment line?

Also, is it advisable to re-enable the Xenforo addon first, edit the htaccess first or it doesn't matter?

Thanks again:-)
 
Thank you very much! To be clear so I don't brick my website, these two lines go within the IfModule litespeed section, just below the RewriteEngine line of code, and just above the # cache comment line?

Also, is it advisable to re-enable the Xenforo addon first, edit the htaccess first or it doesn't matter?

Thanks again:)

Correct on placement. I don't think adding before or after re-enabling the plugin will make too much difference, but let's just say after since it's a modification on the original rules.
 
So far so good, thank you very much.

Seems to be working as expected now. Somehow I did not brick the website, either;-)

Much appreciated, I will monitor but hopefully it's good to go now.

Have a good week and stay safe!

Correct on placement. I don't think adding before or after re-enabling the plugin will make too much difference, but let's just say after since it's a modification on the original rules.
 
I'm confused as to where this addon/process is picking up configuration options from. It appears to be creating the cache files in /home/xxx/lscache rather than the directory specified in the litespeed web console. It also doesn't appear to be adhering to the TTL specified in either the htaccess or in the LS config, as I have files that are over 2 months old in the cache directory, which has grown to over 50G.

Is there something I'm missing in regards to pruning these old cache files? I can deal with it storing in the user directory, but don't want to hang on files that are well past the TTL.
 
I'm confused as to where this addon/process is picking up configuration options from. It appears to be creating the cache files in /home/xxx/lscache rather than the directory specified in the litespeed web console. It also doesn't appear to be adhering to the TTL specified in either the htaccess or in the LS config, as I have files that are over 2 months old in the cache directory, which has grown to over 50G.

Is there something I'm missing in regards to pruning these old cache files? I can deal with it storing in the user directory, but don't want to hang on files that are well past the TTL.

Howdy @sHORTYWZ,

TTL is controlled by the .htaccess rules added during plugin installation, which would be 360 seconds (6 minutes) if not modified.

I think the setting your looking for is Public Storage Expire (minutes) under "config > page cache" in the webadmin for LiteSpeed Enterprise. This controls how old a cache file can be before the server will attempt to physically remove the file (set it higher than your TTL to prevent removing still valid cache files).

Regards,
-Michael

Edit: As for /home/xxx/lscache , that would be the set virtual host cache root by the looks of it. If you'd rather keep everything under the server cache root directory, you can blank this setting. If you changed this setting but are not seeing a change, perform a graceful restart of the server.
 
Public Storage Expire (minutes)

Thanks for the response! I just discovered this last night after I made my post and enabled it. It seems strange that there isn't a default value for this, no?

Is there a way to manually kick this process off once the value is set, or do I just have to wait for the timer to count down?
 
Thanks for the response! I just discovered this last night after I made my post and enabled it. It seems strange that there isn't a default value for this, no?

Is there a way to manually kick this process off once the value is set, or do I just have to wait for the timer to count down?

Glad you found it. Unfortunately I don't think there's a way to trigger the clean action manually. Sorry about that.
 
@Michael A. - I dropped that setting down to 60 minutes and did a graceful restart - it's been a couple hours and there is no change to the lscache directory. Any thoughts?

LMK if I should move this over to a DM or LS support - don't want to clog up this thread any more than we have to.
 
@Michael A. - I dropped that setting down to 60 minutes and did a graceful restart - it's been a couple hours and there is no change to the lscache directory. Any thoughts?

LMK if I should move this over to a DM or LS support - don't want to clog up this thread any more than we have to.

I think the setting in this case is just the age of the file before removal, but the removal itself only happens once a day (not sure exactly when). No worries about clogging up the thread in this case, I'm sure this is something that others appreciate learning about as well :)

You can of course create a support ticket with us at anytime if you need more help/have an issue.

Regards,
-Michael
 
Hey @Michael A. - we're at 36 hours since I enabled the Public Storage Expires option and it still has not pruned anything, so I took matters into my own hands :)

Found this doc:

and ran
Code:
/usr/local/lsws/admin/misc/cleancache.sh /home/nes/lscache/

Which successfully took the cache directory down to a respectable number again. I'll keep an eye on this for the timer based job to run, but otherwise may just schedule this script via cron as suggested.
 
Ah, that might be best then. I'll pass along your experience to the dev responsible as it sounds like there could be a bug (that or virtual host inheritance is causing it to act differently in which case we can update our docs).

Thanks for letting me know,
-Michael
 
Ah, that might be best then. I'll pass along your experience to the dev responsible as it sounds like there could be a bug (that or virtual host inheritance is causing it to act differently in which case we can update our docs).

Thanks for letting me know,
-Michael

Thanks! This is a cPanel box, if that makes any difference.
 
Top Bottom