[Rg 126] Re: patch for supporting Last-Modified and If-Modified-Since headers

gabriele renzi rff.rff at gmail.com
Sun Jan 13 18:15:03 EST 2008


On Sun, 13 Jan 2008 08:44:06 +0900, Keita Yamaguchi wrote:

> Hi,
>
> This is a Ramaze::Dispatcher::File patch for supporting Last-Modified
> and If-Modified-Since headers.
>
> Regards,

I extended the patch to add ETag support (If-None-Match: "tag"), and 4
tests for this two things.
I had to change spec/helper/mock_http so that the special params
:if_modified_since=>date and :if_none_match=>"etag" are treated
correctly (as :referer,:cookie etc).

I'm not sure the thing behaves correctly though, so please check it.

As for ETag: I'm building the hash as MD5(filename+mtime) instead of
reading the whole file to hash it, it may have sense to add file size
or inode number.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cache.patch.gz
Type: application/x-gzip
Size: 1879 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/ramaze-general/attachments/20080114/8adf8836/attachment.gz 


More information about the Ramaze-general mailing list