Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello!
after update to version 2.19 - gzip is failing for js / css files.
Statusreport:
Adv CSS/JS Agg - gzip gzip is failing for js files.
The web servers configuration will need to be adjusted. In most cases make sure that the webroots .htaccess file still contains this section "Rules to correctly serve gzip compressed CSS and JS files". Also check in the readme, under Troubleshooting. Certain default web server configurations (nginx) do not gzip HTTP/1.0 requests. If you are using cloudfront you will have to add metadata to the .gz files. There are some other options if using cloudfront. Raw request info:
stdClass Object
(
[request] => GET /cache/advagg_js/js__-QJyXgjDfMV_ER_vffNtaUp3snZAg8Giiu2zFRZ3n9U__D0kz5oX8INCX1aocfbKa3dnHRnCELXeFcmxZY1yccMI__H-FoKJWreHdHf2gxz0Ot_jHYqRz_qRZJu6TztYwGCD4.js HTTP/1.0
Accept-Encoding: gzip, deflate
Connection: close
Referer: xxx/admin/reports/status
User-Agent: Drupal (+http://drupal.org/)
Host: xxx
[data] => ...
[protocol] => HTTP/1.1
[status_message] => OK
[headers] => Array
(
[content-type] => application/javascript
[content-length] => 13987
[connection] => close
[date] => Mon, 07 Nov 2016 20:16:50 GMT
[server] => Apache
[x-content-type-options] => nosniff
[last-modified] => Sun, 06 Nov 2016 15:25:01 GMT
[accept-ranges] => bytes
[cache-control] => max-age=31449600, no-transform, public
[expires] => Mon, 06 Nov 2017 20:16:50 GMT
)
[code] => 200
)
(the same from css)
Greetings
Frank
Comment | File | Size | Author |
---|---|---|---|
#19 | advagg-2825530-19-fix-symlink.patch | 4.98 KB | mikeytown2 |
Comments
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedhave you ran update.php yet?
Comment #3
Frank.dev CreditAttribution: Frank.dev commentedYes!
Comment #4
mikeytown2 CreditAttribution: mikeytown2 commentedDoes the error go away if you remove the new .htaccess changes in sites/default/files/advagg_js? Keep only what's in the FilesMatch section.
Comment #5
Frank.dev CreditAttribution: Frank.dev commentedAfter remove the .htaccess changes - statusreport return:
Comment #6
mikeytown2 CreditAttribution: mikeytown2 commentedWhat version of apache are you using?
Here's the latest patch for core .htaccess
https://www.drupal.org/node/2193333#comment-11460765
Comment #7
Frank.dev CreditAttribution: Frank.dev commentedApache version 2.4.
After patching the drupal core .htaccess, the error message remains.
Comment #8
Frank.dev CreditAttribution: Frank.dev commentedSoory, error resolved.
When I editing the .htaccess in sites/default/files/advagg_js I had caused a syntax error. I have this corrected and now everything works again (with #4).
Many thanks mikeytown!
Frank
Comment #9
Frank.dev CreditAttribution: Frank.dev commentedI think my original problem has been solved. There is, however, another problem, also after the update of this module. But to this I open a new Issue.
Comment #10
mikeytown2 CreditAttribution: mikeytown2 commentedKeeping this open as I would like to code fix for this.
Comment #11
mikeytown2 CreditAttribution: mikeytown2 commentedWhat's you exact server environment? I'm also using Apache 2.4. Being able to replicate this behavior would allow for me to get a proper fix in place.
https://httpd.apache.org/docs/2.4/mod/core.html#loglevel
If you're wondering what I'd do, I put this in the apache config
LogLevel trace6
And then issue a single request and see why gzip wasn't returned.
Comment #12
Frank.dev CreditAttribution: Frank.dev commentedI am not using a root server.
I have only "/admin/reports/status" and "/admin/reports/status/php" for information.
Comment #13
mikeytown2 CreditAttribution: mikeytown2 commentedExample outputs from the php status page. This should help me if you can provide this info
Comment #14
Frank.dev CreditAttribution: Frank.dev commentedIt is just called "Server: Apache" and PHP 7.0.12.
Comment #15
marcolz CreditAttribution: marcolz commentedIt seems that the rewriting breaks the location of the file and prepends the apache document root to the physical path:
These are the final two lines from a trace6 output. My document root is /opt/mmh/www/napps while drupal runs from /usr/share/drupal7
I am running Ubuntu 14.04 LTS
Comment #16
marcolz CreditAttribution: marcolz commentedRemoving the new
IfModule mod_headers.c
block from the .htaccess files in advagg_js and advagg_css fixes it for me in the sense that my JS and CSS files are served again, compressed with gzip.Comment #17
mikeytown2 CreditAttribution: mikeytown2 commentedI Coping core; going to try something else
http://cgit.drupalcode.org/drupal/tree/.htaccess#n156
Can you try this?
Comment #18
mikeytown2 CreditAttribution: mikeytown2 commentedThinking I might need to add
Options +FollowSymLinks
To the file. Does that make it work?
Comment #19
mikeytown2 CreditAttribution: mikeytown2 commentedI can't reproduce this bug locally; can anyone test and see if this fixes the issue for you?
Comment #21
mikeytown2 CreditAttribution: mikeytown2 commented#19 has been committed. Please change the status if this is still a problem.
Comment #23
jrbJust wanted to add that we were having the same problem where CSS/JS files were not being compressed after upgrading to 7.x-2.19. We found that just adding "RewriteEngine On" to the .htaccess files in the advagg directories fixed the problem. Then, we found this issue(!). In our case, adding "FollowSymLinks" was not needed. This patch does fix the issue.
For reference, we're running Apache/2.2.15 (Unix) with PHP 7.0.14. The strange thing was that it worked fine running under MAMP (Apache/2.2.31 (Unix), PHP 7.0.12). Not sure what difference might be.
Comment #24
numerabilis CreditAttribution: numerabilis commentedI tryed to aply this patch but has errors:
After that my site returns Error 500