Opened 12 years ago

Closed 9 years ago

#29 closed design (fixed)

Age calculation

Reported by: mnot@… Owned by: julian.reschke@…
Priority: normal Milestone: 10
Component: p6-cache Severity: Active WG Document
Keywords: Cc:

Description

RFC 2616 says:

Because the request that resulted in the returned Age value must have been initiated prior to that Age value's generation, we can correct for delays imposed by the network by recording the time at which the request was initiated. Then, when an Age value is received, it MUST be interpreted relative to the time the request was initiated... So, we compute:

corrected_initial_age = corrected_received_age + (now - request_time)

I suspect the formula does not match the true intent of the RFC authors. I believe that corrected_initial_age formula counts server-to-client delays twice. It does that because the corrected_received_age component already accounts for one server-to-client delay. Here is an annotated definition from the RFC:

corrected_received_age = max(
now - date_value, # trust the clock (includes server-to-client delay!)
age_value)        # all-HTTP/1.1 paths (no server-to-client delay)

I think it is possible to fix the corrected_initial_age formula to match the intent (note this is the *initial* not *received* age):

corrected_initial_age = max(
now - date_value,                # trust the clock (includes delays)
age_value + now - request_time)  # trust Age, add network delays

There is no need for corrected_received_age.

Moreover, it looks ALL the formulas computing current_age go away with the above new corrected_initial_age definition as long as "now" is still defined as "the current time" (i.e., the time when current_age is calculated):

current_age = corrected_initial_age

So, we end up with a single formula for all cases and all times:

current_age = max(now - date_value, age_value + now - request_time) = = now - min(date_value, request_time - age_value)

It even has a clear physical meaning -- the min() part is the conservative estimate of object creation time.

Attachments (1)

i29.diff (1.6 KB) - added by julian.reschke@… 10 years ago.
Proposed patch for part 6.

Download all attachments as: .zip

Change History (16)

comment:1 Changed 12 years ago by mnot@…

Proposal:

creation_time = min(date_value, request_time - age_value);
current_age = now - creation_time;

comment:2 Changed 12 years ago by mnot@…

  • Component set to cache
  • Milestone set to unassigned
  • version set to d00

comment:3 Changed 10 years ago by mnot@…

  • Owner set to fielding@…
  • Priority set to normal

comment:4 Changed 10 years ago by fielding@…

Note to self: compare the currently specified algorithm with the one in

http://ftp.ics.uci.edu/pub/ietf/http/draft-fielding-http-age-00.txt

comment:5 Changed 10 years ago by mnot@…

  • Severity set to Active WG Document

AFAICT draft-fielding-http-age is orthogonal; it repeats the algorithm from 2068, but explicitly doesn't propose any modification (see section 2).

Changed 10 years ago by julian.reschke@…

Proposed patch for part 6.

comment:6 Changed 10 years ago by julian.reschke@…

From [792]:

make age calculation a bit less conservative (related to #29)

comment:7 Changed 10 years ago by mnot@…

  • Milestone changed from unassigned to 10

comment:8 Changed 10 years ago by julian.reschke@…

From [795]:

make age calculation a bit less conservative - mention this in "Changes from RFC 2616" (related to #29)

comment:9 Changed 9 years ago by julian.reschke@…

  • Owner changed from fielding@… to julian.reschke@…

pending review

comment:10 Changed 9 years ago by julian.reschke@…

  • Status changed from new to assigned

This is believed to be fixed in -09. Should be reviewed.

comment:11 Changed 9 years ago by mnot@…

I think you mean fixed in -10...

comment:12 Changed 9 years ago by julian.reschke@…

Indeed. So it was fixed after -09, and is pending until we get -10 out.

comment:13 Changed 9 years ago by julian.reschke@…

  • Resolution set to incorporated
  • Status changed from assigned to closed

comment:14 Changed 9 years ago by mnot@…

  • Resolution incorporated deleted
  • Status changed from closed to reopened

comment:15 Changed 9 years ago by mnot@…

  • Resolution set to fixed
  • Status changed from reopened to closed
Note: See TracTickets for help on using tickets.