From: Ken W. <ke...@ma...> - 2002-05-22 01:28:55
|
On Wednesday, May 22, 2002, at 12:46 AM, Oleg Bartunov wrote: > On Tue, 21 May 2002, Jonathan Swartz wrote: > >> The problem is how to know whether to send the NOT_MODIFIED, >> right? Mason >> would have to determine whether any of the components needed >> for the page, >> or any of the data for those components, had changed. > > I think it's up to component to decide what's last modified date and > send according header. We do know how to estimate last modified date of > requested page and we do send header. Mason should just know that > request was conditional and, if last modified header exists, compare > dates and return NOT MODIFIED without body if dlm < if_modified_since I HIGHLY HIGHLY recommend looking at the recent mod_perl Developer's Cookbook, which goes into detail about this issue. The upshot is that you don't want to implement the logic yourself, you want to use the special Apache::File methods that exist for this purpose, especially $r->set_last_modified() and $r->meets_conditions(). -Ken |