How to configure mod_deflate to serve gzipped assets prepared with assets:precompile

When running the assets:precompile rake task, gzipped versions of your app's assets are created. According to the Rails guide for the asset pipeline, you can configure your web server (in my case Apache 2.2) to serve these precompressed files instead of having the web server do the work.

What I can't figure out is how to get mod_deflate configured so that these files are served instead of being double-compressed and then served?

I have mod_deflate enabled via httpd.conf:

AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

And I've converted the code on the rails guide to go into the .htaccess in public/assets:

# Some browsers still send conditional-GET requests if there's a
# Last-Modified header or an ETag header even if they haven't
# reached the expiry date sent in the Expires header.

Header unset Last-Modified
Header unset ETag
FileETag None

# RFC says only cache for 1 year

ExpiresActive On
ExpiresDefault "access plus 1 year"

# Serve gzipped versions instead of requiring Apache to do the work

RewriteEngine on
RewriteCond %{REQUEST_FILENAME}.gz -s
RewriteRule ^(.+) $1.gz [L]

# without it, Content-Type will be "application/x-gzip"

<FilesMatch .*\.css.gz>
    ForceType text/css

<FilesMatch .*\.js.gz>
    ForceType text/javascript

Any ideas how to set this up properly?

Correct Apache AddType directives for font MIME types

I’m using @font-face for embedded fonts (thanks Paul Irish). In trying to fix Chrome’s warning about wrong MIME type for woff fonts, I’ve discovered a mass of conflicting suggestions.

Everyone seems to agree that .eot fonts (for IE 6-8?) should be served using

AddType application/ .eot

For .ttf fonts (older non-IE browsers?) I’ve seen

AddType application/x-font-ttf        .ttf
AddType application/octet-stream      .ttf
AddType font/truetype                 .ttf
AddType font/ttf                      .ttf

And for .woff fonts (the new standard?) I’ve seen

AddType application/font-wof          .woff
AddType application/x-font-woff       .woff
AddType application/x-woff            .woff

I understand the correct MIME type for woff will be application/font-woff, but until the standard is official, application/x-font-woff is understood by Chrome.

I realise I’ve half answered my question in asking it, but the question is really: is there any authoritative guidance or further advice about what MIME types should be used for fonts?

Update (in case it’s of any help to anyone else): since there seems to be nothing authoritative, I’ve settled on using the following font MIME types in my .htaccess (which at least keeps Chrome happy):

AddType application/ .eot
AddType application/x-font-ttf        .ttf
AddType application/x-font-woff       .woff

Server unresponsive after AJAX call is aborted

I have a situation where my Ajax call to the server may take a long time (30-40 seconds). I am using jQuery.ajax and setting the timeout to 60 seconds. So, if I do not get any response in 60 seconds, the call is aborted and an error is reported.

The problem now is any successive calls to the server after this point just keeps waiting, not just AJAX calls, even opening up a new page from the same server in a new window, just keeps waiting. The only way to get it working again is to restart the browser completely. What might be causing this? Is this something to do with the server?

Maven bundle packaging problem, known as MNG-4338

I'm having trouble with the maven-bundle-plugin:

I want to deploy my project as a osgi bundle, wherefore I use the packaging as bundle. But it seems that the pom does not know a packaging as a bundle. Here you can see my pom.xml:

<project ...>...

<name>Simple CXF project using spring configuration</name>





They say, this bug has already been fixed (, but to me it seems it hasn't. Has anyone encountered this problem before and found a solution?

The Error message is like this:

[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   The project com.talend.liugang.cxf:java_first_jaxws:1.0.0 (C:\Users\Andreas\workspace\java_first_jaxws\pom.xml) has 1 error
[ERROR]     Unknown packaging: bundle @ line 7, column 13
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]

Best regards, saen