-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Fixed Apache Optimization #9244
Fixed Apache Optimization #9244
Conversation
Hello @Pedrock! This is your first pull request on the PrestaShop project. Thank you, and welcome to this Open Source community! |
@@ -194,7 +194,7 @@ private function manageApacheOptimization($enabled) | |||
|
|||
// feature activation | |||
if (false === $isCurrentlyEnabled && true === $enabled) { | |||
if ($this->tools->generateHtaccess()) { | |||
if ($this->tools->generateHtaccess(null, null, 1)) { | |||
$this->configuration->set('PS_HTACCESS_CACHE_CONTROL', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the configuration should be set before calling generateHtaccess()
? That way we wouldn't need to pass any parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would simplify the change but the user won't have any kind of feedback if the operation fails. You can tell me how you prefer it I can change it accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would that be? You just need to tweak the code a little like this:
$this->configuration->set('PS_HTACCESS_CACHE_CONTROL', true);
if (!$this->tools->generateHtaccess()) {
$errors = array(
// ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eternoendless Thank you for the feedback. I have updated the code
19ecc35
to
3cd294d
Compare
Thanks for the changes! Would you mind rebasing onto |
f5e0a1d
to
3cd294d
Compare
@eternoendless Do you want me to rebase onto |
Rebase into develop and change the target branch please. |
3cd294d
to
526d89b
Compare
@eternoendless done! |
Travis ran properly, but sha1 don't match: https://travis-ci.org/PrestaShop/PrestaShop/builds/407597070 Merging. |
- Go to Advanced Parameters -> Performance and enable Apache optimization
- The browser should now be caching all asset files, including JS and CSS (the main .htaccess should include "ExpiresActive On" and a "ExpiresByType" for each file type)
This change is