Shopping Cart Cache

Lee

Well-Known Member
#1
Hello,

I've very new to opencart and all that goes with it so I'm not very knowledgeable - yet.

Right now the cart is being cached and it's driving my customers mad because they aren't using the refresh button in the browser, so how can I get litespeed to not cache the shopping cart?

Thanks,
Lee
 

AndreyPopov

Well-Known Member
#2
Hi!

you can disable all Ajax settings
first - Ajax Load Shopcart

than check if you LiteSpeede server is Web Server edition - disable ESI common/cart feature
or full disable ESI

also can try to disable Separate cache for logged users.
 

Lee

Well-Known Member
#3
Thank you AndreyPopov,

I have already disabled ESI, it broke the filter functions.
I also have separate cache turned off.
So I will try the ajax adjustment!

Lee
 

Lee

Well-Known Member
#4
OK, that did not fix it.
Below is code that does fix it when put into the .htaccess but I'm not sure if this will interfere with outher potential cache features.

# Stop caching the cart
RewriteEngine On
<FilesMatch "\.(html|htm|php)$">
FileETag None
<IfModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 12 Jan 1980 05:00:00 GMT"
</IfModule>
</FilesMatch>
 

Lee

Well-Known Member
#5
Update:

This no longer fixes the cached cart issues. Hosted on A2 servers

Please help with any info available, I'm at the end of my rope with this issue!
 

Lee

Well-Known Member
#6
I guess I'll update my own request!

The answer to my problem is adding this line to the .htaccess file:

RewriteCond %{QUERY_STRING} !nocache|cart|checkout [NC]

I'm very surprised no one knows about this.
 
Top