# Using send\_file and handling browser side cacheing

**URL:** <https://www.ruby-forum.com/t/using-send-file-and-handling-browser-side-cacheing/88128>\
**Category:** Rails\
**Created:** [March 8, 2007, 11:49am UTC](https://www.ruby-forum.com/t/using-send-file-and-handling-browser-side-cacheing/88128 "2007-03-08T11:49:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mezza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/43a26b/32.png) [@mezza](https://www.ruby-forum.com/u/mezza)\
**Post date:** [March 8, 2007, 11:49am UTC](https://www.ruby-forum.com/t/using-send-file-and-handling-browser-side-cacheing/88128/1 "2007-03-08T11:49:31Z")

</div>

I’m using send\_file to send rather large SWF files that I’d prefer the  
end browser to cache to reduce my bandwidth usage.

I’ve used the method suggested by madrobby ([http://mir.aculo.us/](http://mir.aculo.us/)  
2005/08/28/internet-explorer-and-ajax-image-caching-woes) to try to  
catch the HTTP\_IF\_MODIFIED\_SINCE request header, and then return HTTP  
304 if necessary. However, this only seems to work reliably with  
Firefox and IE7, and not Safari. Oddly, even with Firefox, I don’t  
actually see the HTTP 304 response in my lighttpd logs though.

Does anyone know of a practical solution to this?

FYI, I’m using lighttpd with FCGI instances of my rails app.

TIA,

Mezza
