httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy T. Fielding" <field...@kiwi.ics.uci.edu>
Subject Re: [PATCH] (PR 894,895) ETags, Last-Modified, and scripts
Date Thu, 21 Aug 1997 23:24:10 GMT
>>>+    mtime = (last_mtime != NULL) ? parseHTTPdate(last_mtime) : time(NULL);
>>
>>This is a bad plan.  You should be passing mtime to the function, not
>>doing an expensive string parse of a string that was just created.
>
>    You're making the assumptions that a) modification times are
>    *always* a factor in *every* input condition check, and b) that
>    meets_conditions() is *always* called right after set_{etag,lm).

Ummm, not really.  I'm making the assumption that extracting mtime from
the header fields is always several thousand cycles more expensive than
just passing it as a parameter.  If you don't have mtime handy (which
is not the case for any of the current calls), then just pass in (time_t)0.

>    You're the HTTP cop; is [a] a valid assumption?  If it is, then it's
>    reasonable to pass the mtime to meets_conditions(), which I intended
>    as a general condition-check function.

Generality is good, but there is always a balance between the need for
abstraction and the need for performance.  Given that we already know
that mtime is needed for at least one condition, it should be passed-in
either as its own parameter or as part of the request_rec.

....Roy

Mime
View raw message