Post by contact@deal-h.co.uk » Mon May 04, 2020 1:32 am

replace

This below solution worked like a charm to me when I faced the same issue.

Code: Select all

// Response
$response = new Response();
$response->addHeader('Content-Type: text/html; charset=utf-8');
$response->setCompression($config->get('config_compression'));
$registry->set('response', $response);
with

Code: Select all

// Response
$response = new Response();
$response->addHeader('Content-Type: text/html; charset=utf-8');
$response->addHeader('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$response->addHeader('Pragma: no-cache');
$response->setCompression($config->get('config_compression'));
$registry->set('response', $response);
Last edited by straightlight on Mon May 04, 2020 1:51 am, edited 1 time in total.
Reason: Added code tags.


Posts

Joined
Mon May 04, 2020 1:17 am

Post by straightlight » Mon May 04, 2020 1:52 am

Ensure to read this FAQ prior on using this workaround code: viewtopic.php?f=134&t=215776#p775632 also to add that your first post does not explain, in details, why you would need to use such codes.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member
Online

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by letxobnav » Mon May 04, 2020 9:55 am

you can ignore that so-called FAQ

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by straightlight » Mon May 04, 2020 11:36 am

There is nothing wrong with the FAQ.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member
Online

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by danielb123 » Fri May 22, 2020 6:57 am

what do this code change exactly ? disable all cache ? i have the same issue with cart update when i use mod expire headers or turbocache from a2 hosting
contact@deal-h.co.uk wrote:
Mon May 04, 2020 1:32 am
replace

This below solution worked like a charm to me when I faced the same issue.

Code: Select all

// Response
$response = new Response();
$response->addHeader('Content-Type: text/html; charset=utf-8');
$response->setCompression($config->get('config_compression'));
$registry->set('response', $response);
with

Code: Select all

// Response
$response = new Response();
$response->addHeader('Content-Type: text/html; charset=utf-8');
$response->addHeader('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
$response->addHeader('Pragma: no-cache');
$response->setCompression($config->get('config_compression'));
$registry->set('response', $response);

Journal 3 Rulz 8)


Newbie

Posts

Joined
Wed Nov 15, 2017 8:48 pm

Post by ADD Creative » Fri May 22, 2020 11:25 pm

It sets headers in the response to tell the web browser no to cache that response. It's added to system/framework.php so the headers are only set for the dynamic responses generated by PHP and does not affect the caching of your static files.

If you are setting future expires headers they you will also want to add past expires to the dynamic responses. See the example below.
viewtopic.php?f=202&t=206449#p786660

www.add-creative.co.uk


Active Member

Posts

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

Users browsing this forum: No registered users and 36 guests