LSCache purges all cache on product edit

#1
Hi,

Litespeed Cache purges all cache when we edit product in admin. Not just the related pages like product and category page.

It clears cache for homepage, all categories, all products.

And we add/edit/delete products every day so basically during working hours most of the time there is no cache for the users.

We use opencart 3.0.2.0

Any suggestions?
 

AndreyPopov

Well-Known Member
#2
Hi!

what version of LSCache plugin installed?
and what other settings in LSCache plugin module?

what your version of LiteSpeed server on your host: Web Server or OpenLiteSpeed?
 

AndreyPopov

Well-Known Member
#4
try disable "Separate cache for logged-in users" on General Tab
and off all Page cache (Login) on Page Settings

IMHO - no matter use different copy of cache for logged and for not-logged (guest) users.
 

Germont

Well-Known Member
#5
Same story for me, but I have installed the latest version of the plugin. It has one more tab regarding urls.
Quite frustrating to rebuild cache every 3 hours.
 
Last edited:

Germont

Well-Known Member
#7
It seems there is a temporary workaround for this bug.
Just empty line 247 from /public_html/admin/controller/extension/module/lscache.php
But line 248 must remain the same.
I had to disable and reenable the extension to use the new php file.
PHP:
$this->model_setting_event->addEvent('lscache_product_edit', 'admin/model/catalog/product/editProduct/after', 'extension/module/lscache/editProduct');
The homepage and another random product kept their cache, compared to native file, when they were purged.
The updated product purged just fine, and new description +quantity are visible.
https://check.lscache.io/ can be used for confirmation.
 
Last edited:

Germont

Well-Known Member
#9
For me it's missing just because I've removed it from the php :) But momentarily can't afford rebuilding cache one more time.
Then it's not a bug, just a misunderstood feature.

You're a bright guy, thanks!
*************
Now it seems visitors can't have the updated version of the edited product, as also its cache it's not purged.
 
Last edited:

Lee

Well-Known Member
#12
I have the latest version of the extension and it still doesn't work right. If I make a change to any one product it purges cache on them and and I need to rebuild all the products and categories. Is there any fix for this?

Is anyone even working on litespeed for opencart anymore? There are so many issues that make it more of a pain than a benefit.

I see so much data for WordPress but for opencart it seems to be an afterthought with little to no support...
 

Germont

Well-Known Member
#16
@Lee
Try a preload after a manual full purge. And record the total time required for preload.
For my shop 35 minutes are required.
After product edit, again files are purged, but only related products that page has.

Preloading after editing 1-2 products, lasts only 7-15 minutes, meaning it was a partial purge.
But when editing 5-6 products one after another, even 80-90% of entire cache is invalidated.
This is normal behaviour, but very inconvenient. An option to prevent purge of related cache should also be available.
 

Lee

Well-Known Member
#18
Germont,

It takes 32 minutes after I manually deleted the cached files. I changed just ONE item and it took 28 minutes. I suspect the difference in time is the available cpu time on my shared host.
 

AndreyPopov

Well-Known Member
#19
AndreyPopov, this is the file I have:
all corresponding lines commented.

After product edit, again files are purged, but only related products that page has.
yes. after edit cache for edited product must be cleared.

if edit category - cache cleared for category and all products in this category.


An option to prevent purge of related cache should also be available.
I think, this is not right way.

some changes not critical for recache, but some like Discount, Sales, required Option are critical and must be recached (clear cache)
every time check what changed: critical or non-critical - are you really need this?

option to recache selected category - good idea.
option to recache products "from ... to ...." - also good
 
Last edited:
#20
So is there a solution to this now?

If we have the following:
Category1 and under it:
Product1
Product2
Product3
Product4
Product5...

When I edit Product2 it purges all of the above.

I need it purge just Product2+Category1 BUT NOT the other products.
 
Top