Post by straightlight » Fri Apr 17, 2020 8:01 pm

OSWorX wrote:
Fri Apr 17, 2020 7:01 pm
ADD Creative wrote:
Fri Apr 17, 2020 6:33 pm
It is a bug in OpenCart. Nothing to do with server-specifics. Any PHP application that uses sessions will need to control what a web browser can cache. That's why if you use the native PHP sessions, PHP will do this for you. OpenCart version 3 onwards implements its own sessions and fails to control what a web browser caches, so web browsers are free to cache any response they want to, leading to problems.
So, to simply break that down to 1 line: do not use OpenCart 3.x if you want to avoid troubles with cache - correct?
I have contacted Daniel about this. It seem that despite the OC version being used, let's not forget that the pragma-cache deactivation has been suggested since OC v2.x releases on the forum on anyhow which means cache problems have been persistently reported on OC v2.x releases as well. However, the issue seem to be graver than anticipated by design (concept / goals).

The problem is that even though we use the gc.session_lifetime suggested by engwalid on Github or disable the pragma-cache, it still won't be a proper solution since for the session lifetime, API services will still be focusing on the shortest session length between services that they use as the same for the store owners by relying on their web service providers. As to disable pragma-cache, it is not a safe solution for online users. It will prevent session validation length to overload the browser, that is correct. However, it won't optimize the stores unless using higher resource capabilities such as better servers which is not how and why Opencart has been intended to be shown as a product.

What we need to get out of this misery, again despite the OC version, is the use of a Cloud-as-a-Service (CaaS) solution. This is a major incident by design ...

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by ADD Creative » Sun Apr 19, 2020 12:37 am

OSWorX wrote:
Fri Apr 17, 2020 7:01 pm
So, to simply break that down to 1 line: do not use OpenCart 3.x if you want to avoid troubles with cache - correct?
Yes.

straightlight wrote:
Fri Apr 17, 2020 8:01 pm
I have contacted Daniel about this. It seem that despite the OC version being used, let's not forget that the pragma-cache deactivation has been suggested since OC v2.x releases on the forum on anyhow which means cache problems have been persistently reported on OC v2.x releases as well. However, the issue seem to be graver than anticipated by design (concept / goals).
The issue does not affect 2.x at all.

straightlight wrote:
Fri Apr 17, 2020 8:01 pm
The problem is that even though we use the gc.session_lifetime suggested by engwalid on Github or disable the pragma-cache, it still won't be a proper solution since for the session lifetime, API services will still be focusing on the shortest session length between services that they use as the same for the store owners by relying on their web service providers.
The issue has nothing to do with the session lifetime or garbage collection.

straightlight wrote:
Fri Apr 17, 2020 8:01 pm
As to disable pragma-cache, it is not a safe solution for online users. It will prevent session validation length to overload the browser, that is correct. However, it won't optimize the stores unless using higher resource capabilities such as better servers which is not how and why Opencart has been intended to be shown as a product.

What we need to get out of this misery, again despite the OC version, is the use of a Cloud-as-a-Service (CaaS) solution. This is a major incident by design ...
Sorry, it's not clear what your are trying to say here.
Last edited by ADD Creative on Sun Apr 19, 2020 12:41 am, edited 1 time in total.

www.add-creative.co.uk


Guru Member

Posts

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

Post by straightlight » Sun Apr 19, 2020 12:40 am

While you are still addressing one of the issues, as said on the above, it is larger than the ones being reported about.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by ADD Creative » Sun Apr 19, 2020 12:43 am

I've edit my post above as somehow my responses were missing.

www.add-creative.co.uk


Guru Member

Posts

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

Post by straightlight » Sun Apr 19, 2020 12:52 am

Have it your way but disabling the pragma-cache definitely ain't a permanent solution as being already addressed in the FAQ.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by ADD Creative » Sun Apr 19, 2020 1:25 am

Setting cache control headers is the best way to tell web browsers that they shouldn't cache a response.

www.add-creative.co.uk


Guru Member

Posts

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

Post by straightlight » Sun Apr 19, 2020 2:06 am

ADD Creative wrote:
Sun Apr 19, 2020 1:25 am
Setting cache control headers is the best way to tell web browsers that they shouldn't cache a response.
This strategy is only a workaround. It is not meant to be used as a permanent solution.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by ADD Creative » Sun Apr 19, 2020 2:23 am

Any permanent solution to this issue that didn't involve setting cache control headers would be questionable one.

www.add-creative.co.uk


Guru Member

Posts

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

Post by straightlight » Sun Apr 19, 2020 2:27 am

ADD Creative wrote:
Sun Apr 19, 2020 2:23 am
Any permanent solution to this issue that didn't involve setting cache control headers would be questionable one.
Indeed, it would be questionable from those as well who, during fresh installations of Opencart I had to do for the people as a custom job, did not required the use of this workaround. If it'd be a major incident case regarding pragma-cache issues, I guess very few people would be able to use Opencart v3.x releases still on this day. According to the posts we're receiving on the forum, we can definitely tell it's not the case for everybody but rather only from the specifics where their servers requires it since, obviously, no server configurations are being configured identically.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by ADD Creative » Sun Apr 19, 2020 2:33 am

Again, it's not server specific, but client web browser specific.

www.add-creative.co.uk


Guru Member

Posts

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

Post by straightlight » Sun Apr 19, 2020 2:37 am

ADD Creative wrote:
Sun Apr 19, 2020 2:33 am
Again, it's not server specific, but client web browser specific.
Either case, it then means it has nothing to do with Opencart itself.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by ADD Creative » Sun Apr 19, 2020 3:36 am

It's web browser specific in that the OpenCart problem will manifest itself in different ways in different web browsers.

I'll give you a simple example as you clearly don't understand the issue.

1. Goto https://demo.opencart.com/ in Google Chrome. Preferably in a clean session with nothing added to the cart.
2. Open the developer console (F12).
3. Goto the Network tab in the developer console and ensure "Disable cache" is not ticked, "Preserve log" in not ticked and only "Doc" is selected.
4. Click on the iPhone product to go to the product page.
5. Click add to cart. You should see the item add to the the cart at the top of the page.
6. Click the web browser's back button. You will find the cart now shows as empty. This can really confuse some customers.

If you now look in the developer tool Network at tab for demo.opencart.com, in the Size column you can see "(disk cache)". The means that Chrome use the last version from it's cache and did not request the page from the server that would of had the updated cart total.

Try this with version 2.3.0.2 or less and you won't see the issue. You could compare the response headers in the development tool if you like, where you will see the lack of cache control header in version 3.x.

This is just a simple example of the issue. There can be a lot worse problems if the web browser starts caching AJAX responses at checkout, as the original poster to this topic found.

If you have any other questions or need anything explaining in more detail then just ask.

www.add-creative.co.uk


Guru Member

Posts

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

Post by straightlight » Sun Apr 19, 2020 4:09 am

ADD Creative wrote:
Sun Apr 19, 2020 3:36 am
It's web browser specific in that the OpenCart problem will manifest itself in different ways in different web browsers.

I'll give you a simple example as you clearly don't understand the issue.

1. Goto https://demo.opencart.com/ in Google Chrome. Preferably in a clean session with nothing added to the cart.
2. Open the developer console (F12).
3. Goto the Network tab in the developer console and ensure "Disable cache" is not ticked, "Preserve log" in not ticked and only "Doc" is selected.
4. Click on the iPhone product to go to the product page.
5. Click add to cart. You should see the item add to the the cart at the top of the page.
6. Click the web browser's back button. You will find the cart now shows as empty. This can really confuse some customers.

If you now look in the developer tool Network at tab for demo.opencart.com, in the Size column you can see "(disk cache)". The means that Chrome use the last version from it's cache and did not request the page from the server that would of had the updated cart total.

Try this with version 2.3.0.2 or less and you won't see the issue. You could compare the response headers in the development tool if you like, where you will see the lack of cache control header in version 3.x.

This is just a simple example of the issue. There can be a lot worse problems if the web browser starts caching AJAX responses at checkout, as the original poster to this topic found.

If you have any other questions or need anything explaining in more detail then just ask.
I might have a question or two yes. By looking at the referred commit from Github or by looking on these posts on the topic itself, I fail to see such details to reproduce other than on the previous post. Rather than arguing on the few previous post to finally indicate which steps to reproduce, I think you've been here long enough in this community to rather understand that forum users, including yourself, must understand how important it is to post as much detailed information as possible in order for forum supporters to understand and reproduce the issue you are addressing about rather than directly pointing a post / topic without detailed explanation.

While the commit does, however, provide more details based on technical side of views for the OC developers to take a look at, these aspects on the above should of been formerly addressed to the people since you have been addressing to the public forum that disabling the pragma-cache would resolved the issue as you seem to be looking for this type of solution to be implemented in the core even though the details were incomplete until today.

Therefore, if the instructions on the above you provided can also be found, prior to this date, and as detailed as the ones you have provided above, please point them out and we'll see what we can do from there. Take note that these arguments of yours on this topic without addressing the details as such to clarify the situation you are publicly addressing to the people is against the forum rules since the moderators / administrators of this forum do require forum users to clarify their postings.

Should forum posts be acquired to be edited? This forum does not restrict any users on editing their forum posts nor are they restricted to edit their own commits unless moderators / administrators takes invasive action on these posts. Besides, the Github Opencart namespace does allow Github users to fully edit their own posts without moderation / administrative privileges . As is it now my turn to state: If you do have any questions regarding the ways on posting the details to the public forum, I would invite you to review the forum rules.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by ADD Creative » Sun Apr 19, 2020 7:18 am

I believed, perhaps wrongly, the information in this topic and the GitHub issue I raised would be plenty of information for any developer to understand. I did not anticipate there would be any need to post in any more detail until it became clearer and clearer that you did not understand it yourself. If you think that is worthy of a official warning then I will just have to accept that.

The actuall example is from viewtopic.php?f=202&t=215712 I just posted easier to understand steps to recreate it. I'll update the GitHub issue with the same steps.

www.add-creative.co.uk


Guru Member

Posts

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

Post by straightlight » Sun Apr 19, 2020 8:38 am

ADD Creative wrote:
Sun Apr 19, 2020 7:18 am
I believed, perhaps wrongly, the information in this topic and the GitHub issue I raised would be plenty of information for any developer to understand. I did not anticipate there would be any need to post in any more detail until it became clearer and clearer that you did not understand it yourself. If you think that is worthy of a official warning then I will just have to accept that.

The actuall example is from viewtopic.php?f=202&t=215712 I just posted easier to understand steps to recreate it. I'll update the GitHub issue with the same steps.
The reason being on why the warning was provided has been explained on the above due to the fact that only now, after all this time, you are providing a referral topic where you believe might be the only option to the people to get rid of their cache issues. Only from this post above, you are providing the full step-by-step guide on how to replicate this issue while even on Github, these explanations were and still may not be provided. Should you believe to have a warning regarding the lack of information being provided even though and especially when it involves technical issues? Yes, you should in order for people to understand, nowadays, what hasn't been posted in the past as compared to what it is now. Which is why, forum rules does apply for that specifically so that others can benefit of passed experience from others.

Prior to this day, those steps were not shown on your behalf but rather let people to believe that these changes are accurate and is required for OC v3.x releases until posting these steps while it could of been shown since day 1 based on what people could read rather than not be able to read until today.

Which is why, on Github Opencart namespace, there's a template to be used whenever a commit is being created as it needs to be filled. Otherwise, it is considered an incomplete commit where the information has not been fulfilled accordingly. The same applies on the forum and guidance are being provided and must be respected for OP users to gather the information that they need in order to rectify their incident / service requests.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by letxobnav » Sun Apr 19, 2020 9:13 am

Issue is very clear and has been for a long time.

Anything coming out of the response class should not be browser/proxy cached.
Browsers generally cache as much as they can unless explicitely told not to.
V3 Default does not do this.
These headers tell the browsers and proxies exactly that.

I don't care what the difference is between V2 and V3, the development team should know that themselves, I do know that V3 does not set these headers by default and should.

PS.It will also eliminate problems for users how wrongly set expire default and/or expire on text/html in their htaccess because they read on the internet that it would make their site "Fly".

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 » Sun Apr 19, 2020 9:27 am

letxobnav wrote:
Sun Apr 19, 2020 9:13 am
Issue is very clear and has been for a long time.

Anything coming out of the response class should not be browser/proxy cached.
Browsers generally cache as much as they can unless explicitely told not to.
V3 Default does not do this.
These headers tell the browsers and proxies exactly that.

I don't care what the difference is between V2 and V3, the development team should know that themselves, I do know that V3 does not set these headers by default and should.

PS.It will also eliminate problems for users how wrongly set expire default and/or expire on text/html in their htaccess because they read on the internet that it would make their site "Fly".
While the OC developers may or may not have known about this, the reality is that we're providing support over the forum for a reason and this reason to gather information about the product. If and when something needs to be reported, the steps needs to be provided despite if it's about a technical issue or a general inquiry. Otherwise, while people may indicate that the steps are very clear from Github, again, the addressed steps on the above from this post have not been addressed since all this time until today as to know how can the pragma-cache: no-cache can become the only option without providing the steps? !

Everyday and on, forum supporters, despite their levels, are telling the same thing to OP users once the topic has been created due to missing information on their behalf. It is no different in this situation since a solution is being provided but no documentation is being provided with it. How does that and how can that make sense in the end? People being the developer are developing a solution to help others, granted, but when developing a solution, how can people who many people may believe everyone could understand would actually be able to understand these without providing the step-by-step process? !

If everyone would understand how the process works with OC, then I guess nobody would need to ask on the forum - everybody have their answers. All works fine right? I am sure everyone can believe that no new topics are being created on the forum to report their issues, it's empty everywhere which is why nobody needs to reply to the people that seeks for guidance. Now, as I'm sure you understand the goal of this situation, when providing a solution with code changes, one should not have the need to the many to ask for documentation when the need to implement manual coding. For instance, Github does provide the steps with + and - for each lines in a technical way. Before Github existed, we couldn't even rely on that without the need to develop such features ourselves. However, now that we have it, we're still battling about it because people are still looking for Opencart documentation based on their particular needs.

With that being said, since not all people are obviously technical on that side, if a developer is able to develop a solution, then he's able to document what he did!

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Post by letxobnav » Sun Apr 19, 2020 10:46 am

the addressed steps on the above from this post have not been addressed since all this time until today as to know how can the pragma-cache: no-cache can become the only option without providing the steps? !
This has been addressed almost daily if you bother to read the posts and there is only one step.

Serve these headers along with anything coming out of the response class, i.e. prevent dynamic text/html content caching

Code: Select all

$response->addHeader('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); // prevent browser caching
$response->addHeader('Pragma: no-cache'); // prevent proxy and http/1.0 caching
You can do that in framework or in the response class itself but it is the responsibility of OC default to handle this if it is a requirement for the site to work properly as it is, or make it a server pre-requisite or put it in the default htaccess and make that a pre-requisite.

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 » Sun Apr 19, 2020 6:14 pm

Since these posts are getting repetitive, this topic is now locked.

To conclude, it is inconceivable to believe that a so-called solution is being addressed to the people without posting the actual steps to expect the OC team to replicate the reported issues with the cache until yesterday. As per the FAQ informs the people; disabling the pragma-cache should not be used as a permanent solution and especially, so to add, not during this period of time due to the COVID-19. People are being expected to stay home to work with their home internet connection and disabling the pragma-cache will only affect their domain's performance even more. There's enough to handle with our network traffic as it is and even without the COVID-19 situation, I am sure we can all agree that store owners are already looking for better ways to improve their stores.

Unless the administration approves otherwise, by providing alternative solutions based on the provided step-by-step troubleshooting on this post, as explained on my previous replies, the Github template requires to post detailed steps as to know how the OC team can reproduce reported issues submitted by Github users. The same applies with the forum rules; users are still being amended to address as much as relative details as possible for forum supporters to assist OP users with their incident requests. It's the way it's always been and it's the way it's being maintained to provide a positive level of quality assurance from this community.

Enough said.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

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

Users browsing this forum: No registered users and 10 guests