Page 1 of 1
[SOLVED] Fixes for cache issue
Posted: Mon Nov 12, 2018 7:00 pm
by synapseindia
Hi Guys,
I have reviewed that most of the opencart users are getting cache issue on 3.x versions.
Even i was also facing cache issue such as updated cart and design updated issue.
I have found a solution to fix the same. You can add below code into the htaccess file it will fix your issue.
Code: Select all
<IfModule mod_headers.c>
Header set Cache-Control "no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires 0
</IfModule>
Thanks
Re: Solved - Fixes for cache issue
Posted: Mon Nov 12, 2018 8:56 pm
by ADD Creative
That's not quite right as it will prevent caching of you static files (images, stylesheets, JavaScript, ect.).
It would be best to add the cache control headers to the PHP responses only. See the link below for an example.
viewtopic.php?f=201&t=207498#p737358
I've submitted an bug report here.
https://github.com/opencart/opencart/issues/7008
Re: Solved - Fixes for cache issue
Posted: Mon Nov 12, 2018 9:22 pm
by synapseindia
Great to hear response on this.
I will try this and shall share the feedback .
But i was facing this cache issue since long so it was awsome code to resolve the issue.
Thanks
Re: Solved - Fixes for cache issue
Posted: Mon Apr 05, 2021 1:21 pm
by imdevlper18
Was facing a similar issue on the client website with the extension modification page.
Opencart version 3.0.3.6
The client was using
FastComet Server.
Added .htaccess code of mod_headers for expiry. But that did not help.
Later I contacted the server. And they had caching enabled.
Xvarnish Cache.
So disabling that fixed the issue.
Re: Solved - Fixes for cache issue
Posted: Mon Apr 05, 2021 8:04 pm
by straightlight
imdevlper18 wrote: ↑Mon Apr 05, 2021 1:21 pm
Was facing a similar issue on the client website with the extension modification page.
Opencart version 3.0.3.6
The client was using
FastComet Server.
Added .htaccess code of mod_headers for expiry. But that did not help.
Later I contacted the server. And they had caching enabled.
Xvarnish Cache.
So disabling that fixed the issue.
Good to know. I did explained in the past on the forum this issue might be server-related somewhere. Glad to see the issue was solved after disabling a server cache.
