Closed king-themes closed 6 years ago
@king-themes, thank you for your report. Please try to reproduce this issue on a clean installation without any third-party dependencies.
Eventually the culprit was found. Magento works behind a nodeBalancer who puts the problematic header. I changed the nodeBalancer configuration and the problem resolved.
We have a magento 2.1.9 installation on a Debian Jessie server. It is configured to be connected with Cloudfront CDN for media and static files. The problem is that all the files that are served to CDN contain the header "Cache-Control: private". So the Cloudfront behaves as a transparent proxy just forwarding the request to the Origin.
Preconditions
Steps to reproduce
<FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|html|swf|eot|ttf|otf|woff|woff2)$>
Header append Cache-Control public
</FilesMatch>
<FilesMatch .*\.(ico|jpg|jpeg|png|gif|svg|js|css|swf|eot|ttf|otf|woff|woff2)$>
Header append Cache-Control public
</FilesMatch>
Expected result
-Cache-Control: public
.Actual result
-Cache-Control: public
-Cache-Control: private