Forum: Ruby on Rails Rails, lighttpd and the Expires header

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
0bfcd61fc289de2e441929ecfd00b0ed?d=identicon&s=25 Peter Hickman (Guest)
on 2009-03-14 17:51
(Received via mailing list)
I have a controller that serves up images from a different location
from /public/images/ by using send_file or send_data on /media/thumbs/
38 for example

In lighttpd I have:

expire.url = ( "/media/" => "access 10 years",
         "/stylesheets/" => "access 10 years" ,
                "/javascripts/" => "access 10 years",
                "/images/" => "access 10 years"  )

The correct expires value is being set for /stylesheets/, /
javascripts/ and /images/ but it is not being set for /media/.

Any idea as to how I might get either:
1) lighttpd to set the expires header
2) rails to set the expires header for send_data and send_file

Unless I am doing it completely wrong, in which case so pointers would
be useful.

Thanks.
F03bd1ef0e81c6d28876efceaa290662?d=identicon&s=25 Kaspars Bankovskis (Guest)
on 2009-03-14 21:46
(Received via mailing list)
On Sat, Mar 14, 2009 at 6:50 PM, Peter Hickman <peterhi@ntlworld.com>
wrote:
>                "/images/" => "access 10 years"  )
>
> The correct expires value is being set for /stylesheets/, /
> javascripts/ and /images/ but it is not being set for /media/.
>
> Any idea as to how I might get either:
> 1) lighttpd to set the expires header
> 2) rails to set the expires header for send_data and send_file

expires_in 10.years

There are nice screencasts on this subject at
http://railslab.newrelic.com/

1>
> Unless I am doing it completely wrong, in which case so pointers would
> be useful.
>
> Thanks.
>
>
> >
>



--
Kaspars Bankovskis
0bfcd61fc289de2e441929ecfd00b0ed?d=identicon&s=25 Peter Hickman (Guest)
on 2009-03-15 16:07
(Received via mailing list)
Thanks, I will look into that

Thanks
This topic is locked and can not be replied to.