in reply to $response->current_age() behaving unexpectedly

  1. This has nothing to do with the time difference. If you do a Dumper against your $response, you will see the Date field includes time-zone info:
    use Data::Dumper; ... print Dumper($response);
    When you said sleep(10), you didn't set the current_age to 10s, but just added ABOUT 10s on top of it.
  2. Someone between you and the origin server caches this page, not neccessary to be your direct ISP. The interesting result you got, does prove that current_age() serves its purpose very well. The reason HTTP header including this Date field is to record the time the page was generated on the origin server, and it should not be modified by any one in middle, thus can be used to measure a page's freshness.

Replies are listed 'Best First'.
Re: Re: $response->current_age() behaving unexpectedly
by mooseboy (Pilgrim) on Dec 22, 2002 at 10:48 UTC

    Thanks pg, I followed your Data::Dumper suggestion and also read up on the HTTP RFC 2068. Here's part of the header I get from a request to Perl Monks:

    'date' => 'Sun, 22 Dec 2002 10:14:58 GMT',
    'server' => 'Apache/1.3.26',
    'client-date' => 'Sun, 22 Dec 2002 10:12:17 GMT'

    I *think* I get it now, but the RFC is kinda dull ;-)