All other javascript files successfully aggregate on my site (http://www.warmdebate.com), yet the ga.js file does not.

This is now the biggest file on my site yet it does not send gzip encoding response headers. Being able to gzip this file would reduce the size of ga.js from 23.9kB to 10.4kB; a significant reduction. I suggest looking into properly passing javascript functions through drupal so that the aggregator can pick up on it and compress them.

Comments

hass’s picture

Category: bug » support
Status: Active » Closed (works as designed)

There is no out of the box gzip support in drupal 6 core. The rest is as google designed it.

armanschwarz’s picture

Allowing the code to aggregate and gzip would be a huge benefit. I don't know why you say core doesn't gzip, that's not really the point. The aggregator module does gzip and in 7.x it's core so I don't see why you wouldn't want to take advantage of it. Since the code is being served locally (my ga.js file comes from sites/default/files/googleanalytics/ga.js) I don't see why you wouldn't allow this to happen.

jvinci’s picture

I'm going to agree with Jason here. It would be nice to have the javascript compressed (But leaving issue status as closed out of respect for the hard work this module's maintainer puts in.)

jelo’s picture

Issue summary: View changes

Could we open this up again? It is still an issue in D7. If you use Google Webmaster Tools they complain about the local analytics.js file not being compressed or minified. Despite the default Apache config including compression settings:

# 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>

Why would we not serve the file compressed?

IckZ’s picture

any updates for this?