Does ThirtyBees support LSCache in Litespeed?
Guest last edited by
I’m going to be switching to a new host in the next month and am looking at enabling Litespeed as it’s got the LSCache for PrestaShop. Is this feature going to be obsolete with ThirtyBees or is it still recommended to have Litespeed enabled?
Traumflug last edited by
Best was to find out is to try it. 30bz has a new cache mechanism and removed an old one, so we’d love to hear how well it works compared to Litespeed.
mdekker last edited by mdekker
I’m really wondering if LSCache can beat thirty bees’ built-in cache, but I think that I already know the answer.
While designing the page cache we have tried to make a special FrontController for Varnish cache (which I think basically works the same as LSCache). This would allow thirty bees to use Edge Side Includes for its hole-punching mechanism. Since thirty bees is highly dynamic software, hole-punching is just inevitable.
We hadn’t implemented the whole system for Varnish, but instead tried to cache pages with Varnish and allow it to call our special Controller to fill the gaps in the HTML that was cached by Varnish. We noticed that it was about 50% slower than using the built-in cache with APCu (we’re talking 75ms vs 50ms for the homepage on a simple 4GB/2 cores/SSD VPS). The reason for this speed difference was the extra calls Varnish had to make in order to retrieve the remaining HTML. I bet the LSCache works just like that.
Both Varnish and LSCache inevitably have to retrieve the rest of the HTML from thirty bees, simply because they cannot possibly contain the private caching logic that modules and thirty bees have.
As can be seen in the following image, thirty bees knows which hooks and module combos can be served directly and which ones should always be rendered:
Now try to get that dynamic HTML for only those hooks into Varnish or LSCache. You simply can’t without extra callbacks. You also cannot cache these hooks, because these hooks will always contain dynamic HTML. On every page load.
Where did we find, is the best place to assemble the full page? Answer: the thirty bees
FrontControllerclass. This is the controller where the cached HTML comes together with the calls to all the module (display) hooks.
This leaves us with one more case: distributed systems. What if your site is running on more than one server? If you have a good load balancer, which keeps the session on one node, you should still be able to use the built-in thirty bees cache, but this time it is better to restrict your options to memcache or redis for distributed caching. thirty bees will then still use the regular page cache for the main HTML, but the rest of the HTML is then rendered on the node that is handling the current session.
Guest last edited by
WOW, great answer! Thank you for posting this as having Litespeed limited my choice of servers so wanted to check before I went to a company with less flexibilty but offered Litespeed. I’ve seen the performance boost Litespeed can give to Magento and seeing that it had a PrestaShop module instantly sold me but with us going to switch to ThirtyBees in a few months I wanted to make sure I wasn’t jumping to something that would be obsolete.