Comment #2 on issue 1044 by
marc....@gmx.net: Intermittend CSS/JS
The site is
http://www.tibethunde-ktr.de/ and works without any issues
normally. The issue happened to anonymous users on the frontpage.
The JS file that is added in footer was corrupted. This file has not
changed for about 2-3 years or so.
This are the frontpage (html) headers without mod_pagespeed:
HTTP/1.1 200 OK
Date: Sat, 31 Jan 2015 22:03:08 GMT
Server: Apache/2.2.0 (Fedora)
X-Powered-By: PHP/5.3.3-7+squeeze23
X-Drupal-Cache: HIT
Etag: "1422734562-1"
Content-Language: de
X-Generator: Drupal 7 (
http://drupal.org)
Link: <
http://www.tibethunde-ktr.de/de>; rel="canonical"
X-UA-Compatible: IE=Edge,chrome=1
Cache-Control: public, max-age=43200
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Vary: Cookie,Accept-Encoding
Content-Encoding: gzip
Last-Modified: Sat, 31 Jan 2015 20:02:42 GMT
Keep-Alive: timeout=5, max=10
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
and this the frontpage (html) with mod_pagespeed:
HTTP/1.1 200 OK
Date: Sat, 31 Jan 2015 22:04:55 GMT
Server: Apache/2.2.0 (Fedora)
X-Powered-By: PHP/5.3.3-7+squeeze23
X-Drupal-Cache: HIT
Etag: "1422734562-1"
Content-Language: de
X-Generator: Drupal 7 (
http://drupal.org)
Link: <
http://www.tibethunde-ktr.de/de>; rel="canonical"
X-UA-Compatible: IE=Edge,chrome=1
Cache-Control: public, max-age=43200
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Vary: Cookie,Accept-Encoding
X-Mod-Pagespeed: 1.9.32.3-4448
Content-Encoding: gzip
Cache-Control: max-age=0, no-cache
Content-Length: 12400
Keep-Alive: timeout=5, max=10
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
The hashed footer JS file name
(sites/default/files/js/js_BSu0jYTi1hhxferiVdqvenYcV8QOHR-Bk6nTxZPRthc.js)
is a temp copy of the original file (2012-01-05 23:56:54) and has a file
date of 11. January. The site got broken on 25th and the issue disappeared
for unknown reason. The headers of this JS file
(js_BSu0jYTi1hhxferiVdqvenYcV8QOHR-Bk6nTxZPRthc.js) are:
HTTP/1.1 200 OK
Date: Sat, 31 Jan 2015 22:14:56 GMT
Server: Apache/2.2.0 (Fedora)
Last-Modified: Sun, 11 Jan 2015 16:38:04 GMT
ETag: "5060391-42d-50c630395c166"
Accept-Ranges: bytes
Content-Length: 1069
Cache-Control: max-age=1209600
Expires: Sat, 14 Feb 2015 22:14:56 GMT
Content-Encoding: gzip
Vary: Accept-Encoding
Keep-Alive: timeout=5, max=8
Connection: Keep-Alive
Content-Type: text/javascript
and with mod_pagespeed it is made inline JS so it has no headers :-)
Please note that I'm currently not able to repro the situation by enabling
mod_pageview. This is totally intermittent. The footer js and html code has
for sure not changed since 2012-01-05 23:56:54. These JS file is UTF8
wihtout BOM.
One more thing that may come in mind is that Drupal is gzip'ing the CSS/JS
files under the hood. The gzip is not done by Apache in this case. As I
have no idea how to reproduce this issue - this is just one more guess
about possible reasons. Just to make sure you have the full picture about
this detail I'm posting the Drupal .htaccess file that shows you how the
static GZIP JS file is send to the client.
# Rules to correctly serve gzip compressed CSS and JS files.
# Requires both mod_rewrite and mod_headers to be enabled.
<IfModule mod_headers.c>
# Serve gzip compressed CSS files if they exist and the client accepts
gzip.
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
# Serve gzip compressed JS files if they exist and the client accepts
gzip.
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.js $1\.js\.gz [QSA]
# Serve correct content types, and prevent mod_deflate double gzip.
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1]
<FilesMatch "(\.js\.gz|\.css\.gz)$">
# Serve correct encoding type.
Header set Content-Encoding gzip
# Force proxies to cache gzipped & non-gzipped css/js files
separately.
Header append Vary Accept-Encoding
</FilesMatch>
</IfModule>
</IfModule>
That means if the client accept gzip
the "js_BSu0jYTi1hhxferiVdqvenYcV8QOHR-Bk6nTxZPRthc.js.gz" GZ-file is send
and if not "js_BSu0jYTi1hhxferiVdqvenYcV8QOHR-Bk6nTxZPRthc.js" is send.