letxobnav wrote: ↑Sat Nov 02, 2019 1:47 pm
are you hosted?
if so, did you ask your host what they are setting in httpd.conf?
Sorry for the confusion. It is because I have both OC 2.x & 3.x open side-by-side and I am comparing the response headers from the same action.
First of all let me say that your solution
is actually working 50%.
Secondly, I am on my own personally managed VPS. My apache2.conf & sites-available/example.com.conf has nothing special.
Thirdly, both 2.x & 3.x .htaccess file have 'ExpiresByType text/html "access plus 15 minutes"'
A.
So , with your modification enabled in framework.php, when I click my button...
Code: Select all
route=extension/shipping/modularshipping&token=NuGW9RJ0GvW5T8A27P9TgZmoRuEtR0dg&product_id=422&active_tab=1&addfree
...it does some things at the server and then redirects to the same URL without the parameter addfree (so that the action is not repeated by accident):
Code: Select all
route=extension/shipping/modularshipping&token=NuGW9RJ0GvW5T8A27P9TgZmoRuEtR0dg&active_tab=1
So in Chrome I have the above 2 URLS, the 1st with 302 status and the 2nd with 200 status.
In my previous post I said that I was not seeing any 'Cache-Control' headers.
This is true for the 3.x module, and the 1st URL with 302 status (this is why I said it is working 50%).
The 2.x module, 1st URL with 302 status, actually has 'Cache-Control: no-store, no-cache, must-revalidate'.
However, if I check the second URL (with status 200), which is the URL which the user will see, I get virtually the same response headers for both 2.x & 3.x modules (because of your solution).
There is still a problem with the headers in the redirection (302) in 3.x!!!
B.
with your modification disabled in framework.php, when I click my button...
2.x works as above.
3.x both 302 & 200 URLs pick up the headers from .htaccess and are loaded from 'disk cache' in Chrome.
Conclusion:
Both 2.x & 3.x are virtually identical but I can see a definite difference in how 2.x & 3.x handle headers.
I have no idea how 2.x adds 'Cache-Control: no-store, no-cache, must-revalidate' to its responses, thus avoiding the 'ExpiresByType text/html "access plus 15 minutes"' directive in its .htaccess. I have not made a modification to it in order to do so.
Contrast this with 3.x, where I have to make a modification to framework.php in order to avoid the same directive.
IMPORTANT: If you do not add a 'ExpiresByType text/html "access plus 15 minutes"' directive in .htaccess, you will not face these issues and you will not need to modify framework.php in order to bypass it.
Question:
In my 2.x I found custom 'Cache-Control' headers in the following files:
Code: Select all
\admin\controller\extension\payment\securetrading_ws.php
\admin\controller\journal3\import_export.php
\admin\controller\tool\upload.php
\catalog\controller\account\download.php
\catalog\controller\ebay\openbay.php
\catalog\model\extension\openbay\ebay_openbay.php
So I do not know why I am seeing 'Cache-Control' to the responses from 2.x. It should be behaving just like 3.x and I should be experiencing the same problems - but I am not! Do you know why?