Post by pixacor » Fri Sep 17, 2021 9:04 am

Hello all,

I am running 3.0.7 and everything is fine and dandy. However I turned on server side cache to help the store run better and faster. It worked and the site is now much faster. However, in some cases its too fast and the cart tracking is being lost. For instance I add 2 things to cart. Move around site, and go back to homepage and it shows 0. I know its because the page is now showing as cache.

Is there a way to block an element itself like the cart, from cache? On the server side I only see options to block pages from being cached. But for opencart that doesnt work since its all pages.

Any ideas?

New member

Posts

Joined
Mon Jul 29, 2019 12:55 am

Post by ADD Creative » Fri Sep 17, 2021 4:19 pm

Caching the PHP generated content is not a good idea. Unfortunately there is a bug in 3.x in that it does not set any cache control headers.
viewtopic.php?f=202&t=206449#p786660

If you did want to cache the PHP generated content you would need an extension that loads the cart data after the main page loads. There are a few, but I wouldn't say they are without issues. If your server is running LiteSpeed there is an extision that does that.
https://www.litespeedtech.com/products/ ... celeration

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by paulfeakins » Fri Sep 17, 2021 5:38 pm

pixacor wrote:
Fri Sep 17, 2021 9:04 am
I am running 3.0.7
You wouldn't enter your bank PIN and just randomly miss digits and expect it to work would you?

Equally, OpenCart versions are 4 digits so presumably you mean 3.0.3.7.

pixacor wrote:
Fri Sep 17, 2021 9:04 am
I turned on server side cache to help the store run better and faster.
You think there's only 1 server-side cache in the world?

You'd better get in the habit of giving accurate and specific information if you want help.

For example some server caching tools like https://www.litespeedtech.com/products/ ... celeration can cache full pages or parts of pages, but unless you tell us what one you're using, no one is going to be able to help.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by pixacor » Sat Sep 18, 2021 1:38 am

ADD Creative wrote:
Fri Sep 17, 2021 4:19 pm
Caching the PHP generated content is not a good idea. Unfortunately there is a bug in 3.x in that it does not set any cache control headers.
viewtopic.php?f=202&t=206449#p786660

If you did want to cache the PHP generated content you would need an extension that loads the cart data after the main page loads. There are a few, but I wouldn't say they are without issues. If your server is running LiteSpeed there is an extision that does that.
https://www.litespeedtech.com/products/ ... celeration
Thanks sir! I appreciate the reply and reference. I will look into LiteSpeed. I had since downloaded the lightning extension (That needs $100 license) and it fixed all my issues visually, but I am not so sure on the backend. I will uninstall that one, and try LiteSpeed.

Thank you again.

New member

Posts

Joined
Mon Jul 29, 2019 12:55 am
Who is online

Users browsing this forum: alanjones and 82 guests