Making Mongrel/WEBRick serve static assets with future expires header

I’m creating a Rails application which will be deployed to desktop
machines, running both the webserver and the browser (it’s a test-
taking application which needs to be able to run without an internet
connection).

For this reason, I’ll be running Mongrel or WEBRick, without an Apache/
Nginx in front of it as you would normally do. The browser will access
the Mongrel directly.

The problem I’m facing now is that it takes a while to load assets
(javascript/stylesheets/images). Normally, I’d fix this by setting
future expiry dates on these assets in the Apache proxy in front of
the Mongrel/WEBRick, so that the assets are only requested once, and
after that there is only one request per action.

But in this case, there is no proxy, and i’m using
config.serve_static_assets = true

So the question is: is it possible to tell Mongrel/WEBrick to slap far-
future expiry headers on the static assets?

I’m using Rails 3 on Ruby 1.9.2.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs