Hi

Normally it's expected that static assets are handled by the front end
webserver, such as nginx, which generally make it quite easy to set
whatever expiry header you want.  They'll also serve the file a lot
faster than merb will, and without tying up the ruby process.  If you
really want to do the serving in merb (or, well, ruby) you could look
into rack middlewares, such as Rack::StaticCache[1] which is included
in the rack-contrib gem.  By adding that, or something like it, to
your config/rack.rb to replace the existing static file server, it
should add appropriate cache control headers

Regards
Jon

[1]: 
http://github.com/rack/rack-contrib/blob/master/lib/rack/contrib/static_cache.rb

On 1 October 2010 09:24, George Adamson
<[email protected]> wrote:
> Currently using standard html <script> and <link> tags in the
> application.html.erb.
>
> Is there a way to serve scripts and css with a custom expiry header?
>
> Many thanks,
> George

-- 
You received this message because you are subscribed to the Google Groups 
"merb" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/merb?hl=en.

Reply via email to