LiteSpeed Cache for XF2 - Community

LiteSpeed Cache for XF2 - Community 2.3.0

No permission to download
@Michael A. I'd like to use Quic.cloud for WP on sites that also have XF. Please consider to add Quic.cloud for XenForo.
This would allow us to optimize our images and serve static & dynamic content from a fast CDN. Quic.cloud is a LiteSpeed company, so I hope you can internally talk about this request.
 
@Michael A. I'd like to use Quic.cloud for WP on sites that also have XF. Please consider to add Quic.cloud for XenForo.
This would allow us to optimize our images and serve static & dynamic content from a fast CDN. Quic.cloud is a LiteSpeed company, so I hope you can internally talk about this request.
Of course, I'll pass the request along to the team.
 
At the moment we are WordPress only but plan to expand to more CMS and use cases based on demand. Spending most of our time right now expanding coverage and making sure that everything is rock solid :)
But @Michael A. may I know the actual answer to @Alpha1 's question, please?

I mean, let's say a website is WP, and in the subdirectory, there is an XF site installed.

Will using Quic.Cloud as the CDN for that WP site causes any type of issues for that XF site? (Although I see the options to include/exclude folders from the CDN, but just wanna make sure)
 
But @Michael A. may I know the actual answer to @Alpha1 's question, please?

I mean, let's say a website is WP, and in the subdirectory, there is an XF site installed.

Will using Quic.Cloud as the CDN for that WP site causes any type of issues for that XF site? (Although I see the options to include/exclude folders from the CDN, but just wanna make sure)

Just checked with the team to be sure and the basic answer would be no.

The more complicated answer is that Quic.cloud would likely not be able to recognize XF .htaccess rules. Generic .htaccess rules are probably fine but things like logged in caches, varying on themes, etc will run into issues.

Excluding the XenForo installation directory (or any other non-WordPress CMS) wouldn't really fix that as it is used for CDN mapping only (serving images, css, js from cdn.example.com instead of example.com for example). Since QC itself does not use this mapping, those settings are irrelevant here.

Hope this answer helps.

Regards,
-Michael
 
How can I clean the cache?

You can do so by removing the cache file manually. These are usually stored under the user's home directory, like /home/<user>/lscache, but may vary depending on how your server and virtual host level cache roots are configured in LiteSpeed Web Server. (If a virtual host cache root is not set, these files will be stored under the server cache root)

Regards,
-Michael
 
Hi @Michael A.

After investigating this XF bug report:

We've discovered that - while there are changes for us to make to protect against such things - there is actually an issue in this add-on related to the hashes.json file.

It appears as though it has been edited manually and no longer contains valid JSON:

JSON:
{
    "src/addons/LiteSpeedCache/addon.json": "3c9e44804bc692aee7a05b58ec8b11b0e65fb4a6ff62c65f23bf73c0ac5e2a54",
    "...": "...",
    "src/addons/LiteSpeedCache/_data/code_event_listeners.xml": "2b35eeed3adf0cbf1ecbc8062144ae937188df40f33eb2a251fbca2b4dca4ce0",
}
Note how the last entry has a comma at the end; in JSON this is actually a syntax error and produces invalid JSON.

Can you please push out an update to fix this ASAP and also ensure that going forward the JSON file is produced automatically through the XF tools rather than editing files manually.

If there are issues that require the file to be edited manually, please let us know.

Thanks!
 
Last edited:
Hello @Chris D ,

No problem, I can get an update out shortly. Sorry about that.

We do generate this through XF release tools. I most likely got something crossed on my end while testing/packaging and manually copied the over the line to the existing local source file based on commit history. Will be more careful about this going forward.

Thanks,
-Michael
 
@Michael A.

Just tried upgrading to the latest downloaded version:

Code:
TypeError: XF\Service\AddOnArchive\Extractor::compareHashes(): Argument #1 ($existingHashes) must be of type array, null given, called in /home/XXX/public_html/src/XF/Job/AddOnInstallBatch.php on line 144 src/XF/Service/AddOnArchive/Extractor.php:60
Generated by: MattW Jun 24, 2021 at 5:46 PM
Stack trace
#0 src/XF/Job/AddOnInstallBatch.php(144): XF\Service\AddOnArchive\Extractor->compareHashes(NULL)
#1 src/XF/Job/AddOnInstallBatch.php(77): XF\Job\AddOnInstallBatch->stepInit(Object(XF\Timer))
#2 src/XF/Job/Manager.php(258): XF\Job\AddOnInstallBatch->run(8)
#3 src/XF/Job/Manager.php(200): XF\Job\Manager->runJobInternal(Array, 8)
#4 src/XF/Job/Manager.php(116): XF\Job\Manager->runJobEntry(Array, 8)
#5 src/XF/Admin/Controller/Tools.php(120): XF\Job\Manager->runByIds(Array, 8)
#6 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
#7 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
#8 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
#9 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#10 src/XF/App.php(2337): XF\Mvc\Dispatcher->run()
#11 src/XF.php(488): XF\App->run()
#12 admin.php(13): XF::runApp('XF\\Admin\\App')
#13 {main}
 
@Michael A.

Just tried upgrading to the latest downloaded version:

Code:
TypeError: XF\Service\AddOnArchive\Extractor::compareHashes(): Argument #1 ($existingHashes) must be of type array, null given, called in /home/XXX/public_html/src/XF/Job/AddOnInstallBatch.php on line 144 src/XF/Service/AddOnArchive/Extractor.php:60
Generated by: MattW Jun 24, 2021 at 5:46 PM
Stack trace
#0 src/XF/Job/AddOnInstallBatch.php(144): XF\Service\AddOnArchive\Extractor->compareHashes(NULL)
#1 src/XF/Job/AddOnInstallBatch.php(77): XF\Job\AddOnInstallBatch->stepInit(Object(XF\Timer))
#2 src/XF/Job/Manager.php(258): XF\Job\AddOnInstallBatch->run(8)
#3 src/XF/Job/Manager.php(200): XF\Job\Manager->runJobInternal(Array, 8)
#4 src/XF/Job/Manager.php(116): XF\Job\Manager->runJobEntry(Array, 8)
#5 src/XF/Admin/Controller/Tools.php(120): XF\Job\Manager->runByIds(Array, 8)
#6 src/XF/Mvc/Dispatcher.php(350): XF\Admin\Controller\Tools->actionRunJob(Object(XF\Mvc\ParameterBag))
#7 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
#8 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XF\Admin\Controller\Tools), NULL)
#9 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#10 src/XF/App.php(2337): XF\Mvc\Dispatcher->run()
#11 src/XF.php(488): XF\App->run()
#12 admin.php(13): XF::runApp('XF\\Admin\\App')
#13 {main}
Me as well.
 
I can get around it by editing the existing hashes.json file and removing the additional comma and the end of the last line, but that's supposed to be the purpose of this fix.
 
To workaround the issue for now please edit the XF file src/XF/Job/AddOnInstallBatch.php and find:

PHP:
$existingHashes = $this->currentExistingAddOn->getHashes();

And change to:

PHP:
$existingHashes = $this->currentExistingAddOn->getHashes() ?? [];

Alternatively, you can manually upload the add-on files (the old fashioned way) and trigger the upgrade from your add-on list.

This will work too:

I can get around it by editing the existing hashes.json file and removing the additional comma and the end of the last line, but that's supposed to be the purpose of this fix.

EDIT: Fixed for the next XF release (2.2.6).
 
@Michael A. how do I investigate the issue is if I see this?

1624635433486.webp


htaccess code is at the very beginning of the file, I only edited cookie's names according to my XF settings which is __Secure-

Code:
# LiteSpeed XenForo cache
<IfModule litespeed>
    CacheLookup public on
    RewriteEngine On
    # cache
    RewriteCond %{HTTP_COOKIE} !(__Secure-lscxf_logged_in|__Secure-user|__Secure-session_admin) [NC]
    RewriteCond %{REQUEST_URI} !/install/ [NC]
    RewriteRule .* - [E=Cache-Control:max-age=480,E="cache-vary:__Secure-style_id,__Secure-language_id"]
    # no cache
    RewriteCond %{HTTP_COOKIE} (__Secure-lscxf_logged_in|__Secure-user|__Secure-session_admin) [NC]
    RewriteRule .* - [E=Cache-Control:vary=loggedin,E=Cache-Control:no-cache]
</IfModule>

Could it be because my board is private and this is only the login page? :unsure:
 
Top Bottom