Litespeed also cache the cart

#1
Hi. i have a serious problem where Litespeed cache the carts content different for each page. I saw an atricle on this with woocommerce, but nothing to help fix this in OpenCart. I am on a A2 server and they have their "TurboCache" AKA Litespeed on. the worst thing is that i cant even turn it of. It still cache the content.
Should i change hosting company or is this a problem for OpenCart in general?
You can see my problem with the youtube video here:
 

Unique_Eric

Administrator
Staff member
#4
Hi Jens,

Yes, I can reproduce the issue on your site but not on my fresh OpenCart 3.
Do you have access to edit the .htaccess file to turn TurboCache off for testing?
 
#5
Yeah, i could try to remove their code:

# START A2 LiteSpeed Cache for Your Store
# Type: OpenCart
<IfModule LiteSpeed>
CacheEnable public
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^GET|HEAD|PURGE$
RewriteCond %{HTTP_HOST} "my-domain.com" [NC]
RewriteCond %{REQUEST_URI} !admin|account|checkout|cart [NC]
RewriteCond %{HTTP_COOKIE} !logged_in|cust_logged_in|cart|compare|wishlist [NC]
RewriteCond %{QUERY_STRING} !nocache [NC]
RewriteRule .* - [E=Cache-Control:max-age=900]
</IfModule>
# END A2 LiteSpeed Cache for Your Store


and then install Litespeed after that?

Or is it anything else that needs to be removed as well?
 

Unique_Eric

Administrator
Staff member
#6
Comment out those rules should be good.
Purge cache from LiteSpeed Cache Plugin just in case and wait for 900s, then try reproduce issue again.
 
#7
Ok, I did a new clean install again just to be sure. But yeah, same problem. I have tried all the logical solutions i can think of now. There is another weird problem i see now tho, every time i go back to modules LS is Disabled and uninstall it self, then i press install and enable again, but when i come back its uninstalled again. So in other words, the Admin is also cached. I wonder if you have some settings that i don´t use? or its just A2 servers that have a problem. hmm. could you send me the files for a clean Opencart install where you have LS installed that works for you? Just remove the system files (Config.php) with domain etc so i can change them without problems. I don´t know if that will work, but worth a try.
 

Unique_Eric

Administrator
Staff member
#8
Hi Jens,

LSCache plugin won't cache admin pages at all. Please refresh admin page with web console enabled, see if you can find any `X-LiteSpeed-Cache` tag on it.
For now, I may not send the file since it was fresh installed, nothing special on it.
(opencart version 3.0.3.2 + lscache-opencart3.0-V1.2.1)

Best
 
#9
Then there most be something with A2 servers that i can´t figure out. I have tried Opencart 2 and 3. both manual and trough "softaculous" for that. Whatever i do i will get the same problem. The cart will always be cached. wondering if i should change host again, but i do not know if that will help tho and a huge waste of money on that. Do you have a working site i can check out somewhere?
 

Pong

Administrator
Staff member
#10
You can log a ticket with us and provide tmp root ssh login to the server and opencart admin login in the ticket. We can check for you.
 

Unique_Eric

Administrator
Staff member
#11
for anyone who might be interested, the issue happens due to browser cache, so issue gone when turning off browser cache or web console enabled.
 
#12
I was remove the LS plugin from my opencart 3.0.3.3 twig with fastor themes, ajax cart not working, option delivery for date not working too
 

Wuhua Chen

Active Member
Staff member
#14
hi, you can try disable "LiteSpeed ESI Feature" option, and purge all cache, to see if it work for your site. if still have problem, please submit a ticket and give the admin panel access in ticket.
 

Lee

Well-Known Member
#17
I'm also having the shopping cart cached and I have not been able to fix this for months now. I'm also being hosted on A2.

The only thing that stops caching the cart is to turn off caching! Not what I want to do.

Help!
 

Lee

Well-Known Member
#18
What I found that fixes the caching problem with A2, Opencart v3, Journal 3 is this:
RewriteCond %{QUERY_STRING} !nocache|cart|checkout|wishlist [NC]

The cart works perfectly with this line added to the .htaccess file
 
Top