I'm using Rails 3.1 w/resource pipeline, phusion 3..x and apache 2.2.17.
Within the configuration documentation at http://guides.rubyonrails.org/asset_pipeline.html, in section 4.1.1 it states that I have to give a section to my apache config:
<LocationMatch "^/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" </LocationMatch>
I've been presuming that Phusion Passenger just been "handling" this... or have I been negligent in not RTFM? If I wish to make use of the fingerprinting, should i add this towards the apache config?
If you would like the entire advantages of the resource pipeline, you need to do, indeed, have to add this for your Apache configs. Without that section, your Apache configuration is probably particularly telling browsers not to cache assets - leading to a pointless quantity of round outings between your browser as well as your server.
To be able to get this work, you may want to enable a couple of more Apache modules. To get this done:
sudo a2enmod # Choose headers sudo a2enmod # Choose expires sudo service apache2 restart
To debug your set-up, I suggest while using Live Headers Opera wordpress plugin. By using their, particularly request an resource URL (e.g. http://mysite.com/assets/application-8a0ae0b2d708f797674b7123c37501ba.css)and consider the cache headers pre and post you are making this transformation. Locate an example resource URL using a View Source on any page.
Following the change, you need to observe that the cache expiration is placed to 1 year later on.