When running the assets:precompile rake task, gzipped versions of the app's assets are produced. Based on the Rails guide for that resource pipeline, you are able to configure your internet server (during my situation Apache 2.2) for everyone these precompressed files rather than getting the net server perform the work.

Things I can't determine is how you can get mod_deflate set up to ensure that these files are offered rather than being double-compressed after which offered?

I've 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 have converted the code around the rails guide to enter the .htaccess in public placesOrproperty:

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

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

Any ideas how you can set this up correctly?

First, you wouldn't want mod_deflate to function here. So inside your assets .htaccess file add:

SetEnv no-gzip

This will switch off mod_deflate for the assets.

Second, I personally don't like to disagree using the rails folks, however i think you will find a few inadequacies within their assets .htaccess recipe. The very best part is okay however for RewriteEngine and beyond I'd have:

RewriteEngine on
# Make sure the browser supports gzip encoding before we send it
RewriteCond %{HTTP:Accept-Encoding} \b(x-)?gzip\b
RewriteCond %{REQUEST_FILENAME}.gz -s
RewriteRule ^(.+) $1.gz [L]

# without it, Content-Type will be "application/x-gzip"
# also add a content-encoding header to tell the browser to decompress

<FilesMatch \.css\.gz$>
    ForceType text/css
    Header set Content-Encoding gzip
</FilesMatch>

<FilesMatch \.js\.gz$>
    ForceType text/javascript
    Header set Content-Encoding gzip
</FilesMatch>