Also, why does this method have a Set-Cookie header? It looks as
though this method sets a session cookie in the response. Is this
necessary? Is there a way to disable this?
On 10/9/05, Greg McClure
<gmcclure-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I have a method, inline, like so:
>
> def inline
> img = Magick::Image::read("<path-to-some-image>").first
> img.change_geometry!(DEFAULT_IMG_DISPLAY_W) { |cols, rows, img|
> img.resize!(cols, rows)
> }
> return_data = img.to_blob
> headers[''Cache-Control'']=''public''
> send_data return_data, :type => ''image/jpeg'',
:disposition => ''inline''
> end
>
> It works fine, only the Cache-Control header seems to have no effect.
> What I''d like to do is deliver the dynamically generated image
once
> and then use the browser cache from that point on, at least for the
> current session.
>
> Is there any way to do this? The whole point is to use the
browser''s
> cache, so I don''t want to save the dynamically generated image
> anywhere on the server filesystem if I can avoid that.
>
> Please, please help!
>
> All the best,
> Greg
>