-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Added default Expires header and enabled apache served files compression by default. #1615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…pression by default.
Just wanted to let the M2 team know that this is an issue that is important. A significant majority of the Magento 1 CE sites we take over support for do not have appropriate mod_deflate and mod_expires settings enabled in .htaccess, despite their server having support for it. Wrapping it in an IfModule removes the possibility that this causes severe issues. This would help 'out of the box' Magento 2 installations score higher on the Google Pagespeed Insights test and a number of other 3rd-party testing tools. |
It also might not be a bad idea to get some inspiration from the server-configs projects for this, since they did a lot of research about tweaking different webservers. |
@hostep did you tried the code you mentioned with Magento? What I suggested has been tested in several servers by several devs, I would not recommend adding more changes to this PR to make it simpler and have more chances to be included in the upcoming releases. |
@miguelbalparda Yes, we have used part of the server-configs Apache file in more then 20 Magento CE 1.x shops without any problems. We haven't used all the configuration, but most of the stuff underneath 'WEB PERFORMANCE' we used. We do have timestamped assets in our Magento shops, which doesn't work by default in Magento 1.x, but since Magento 2 also uses timestamped assets (I believe?), it will probably work out of the box, or might need a little bit of tweaking on the Expire headers (I haven't had a good look at it yet). It's a bit silly that the default .htaccess of Magento still checks for Netscape 4.x btw ;) |
We have automated a Magento Contributor License Agreement verifier for contributions sent to our GitHub projects. |
@magento-cicd I just signed the agreement with my github account but it still appears as unsigned. |
@piotrekkaminski I'm trying to sign the CLA but it is not working for some reason. I did the complete flow from mobile and desktop and I'm returned here after accepting but the check is still pending. |
Any news on this one? |
We are currently waiting for the travis builds to be fixed before we can continue to process PRs. Sorry for the delay! |
Are the travis builds still being stabilized? |
@miguelbalparda please, reopen this Pull Request, if you have time to stabilize travis builds. Thank you |
@Vinai @okorshenko builds are now green, see #4390 |
Since most of the servers have mod_deflate and mod_expires enabled by default and given the fact that nothing bad can happen if the server doesn't have those mods enabled while wrapping directives between an IfModule, I think it is safe to uncomment the .htaccess directives to enable compression and add default expire headers.
With these directives enabled everything we call "good practices" is covered in a performance test making the site faster to load in subsequent visits.
See https://gtmetrix.com/reports/magetwod.nextmp.net/HytnADQN for history