[Zope-dev] Last-modified and bobobase_modification_time

Wei He hewei@mail.ied.ac.cn
Thu, 20 Jun 2002 10:18:56 +0800 (CST)


On Wed, 19 Jun 2002, Toby Dickenson wrote:

> 
> The only thing Last-Modified can give you over Expires and Cache-Control is 
> the possibility of sending a 304 Not Modified response code instead of a 200.
> 
> If the response is cheap to calculate and transmit then a 200 may not be much 
> more expensive than a 304, and you are correct that maintaining an accurate 
> last-modified may not be cost-effective.
> 
> However, if the response is expensive to transfer (that is, large) or 
> expensive to calculate, then a 304 may be a significant saving.
> 

You just gave a clear explaination of how Last-Modified will influence the 
transfer. Let's see if everyone get this: 

If maintaning last-modified header is cheap, give an accurate result. If 
not, disable it to the client by sending an expire time in the past or 
something. In either case, Zope's current implementation needs to be 
changed. Because it will give the client a false impression that a page has 
not changed but actually it did.

> > If I understand correctly, the Expires header can only give the
> > client an impression how ofter a page is updated.
> 
> No, it is the opposite of that. It says how long you can assume it will not 
> change.
> 
Aren't they the same? What I meant is the header doesn't guarantee that a page 
won't change before the coming expire time. So using this header won't help a 
client from getting an out-of-date page. The two meaningful uses of this header 
I can think of are:

1. Give an expire time in the past to force a client give up its cache.
2. Set an expire time a fixed period in the future, say 24 hours, 
   to instruct the client that the page is updated daily.

> 
> I suggest you read RFC2616.

I'll do. Thanks.

Wei He