home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc2227 < prev    next >
Text File  |  1997-10-28  |  85KB  |  2,076 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                           J. Mogul
  8. Request for Comments: 2227                                        DECWRL
  9. Category: Standards Track                                       P. Leach
  10.                                                                Microsoft
  11.                                                             October 1997
  12.  
  13.  
  14.             Simple Hit-Metering and Usage-Limiting for HTTP
  15.  
  16. Status of this Memo
  17.  
  18.    This document specifies an Internet standards track protocol for the
  19.    Internet community, and requests discussion and suggestions for
  20.    improvements.  Please refer to the current edition of the "Internet
  21.    Official Protocol Standards" (STD 1) for the standardization state
  22.    and status of this protocol.  Distribution of this memo is unlimited.
  23.  
  24. Copyright Notice
  25.  
  26.    Copyright (C) The Internet Society (1997).  All Rights Reserved.
  27.  
  28. ABSTRACT
  29.  
  30.    This document proposes a simple extension to HTTP, using a new
  31.    "Meter" header, which permits a limited form of demographic
  32.    information (colloquially called "hit-counts") to be reported by
  33.    caches to origin servers, in a more efficient manner than the
  34.    "cache-busting" techniques currently used.  It also permits an origin
  35.    server to control the number of times a cache uses a cached response,
  36.    and outlines a technique that origin servers can use to capture
  37.    referral information without "cache-busting."
  38.  
  39. TABLE OF CONTENTS
  40.  
  41.    1 Introduction                                                      2
  42.         1.1 Goals, non-goals, and limitations                          3
  43.         1.2 Brief summary of the design                                4
  44.         1.3 Terminology                                                5
  45.    2 Overview                                                          5
  46.         2.1 Discussion                                                 7
  47.    3 Design concepts                                                   8
  48.         3.1 Implementation of the "metering subtree"                   8
  49.         3.2 Format of the Meter header                                10
  50.         3.3 Negotiation of hit-metering and usage-limiting            10
  51.         3.4 Transmission of usage reports                             14
  52.         3.5 When to send usage reports                                15
  53.         3.6 Subdivision of usage-limits                               16
  54.  
  55.  
  56.  
  57.  
  58. Mogul & Leach               Standards Track                     [Page 1]
  59.  
  60. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  61.  
  62.  
  63.    4 Analysis                                                         17
  64.         4.1 Approximation accuracy for counting users                 18
  65.         4.2 What about "Network Computers"?                           19
  66.         4.3 Critical-path delay analysis                              19
  67.    5 Specification                                                    20
  68.         5.1 Specification of Meter header and directives              20
  69.         5.2 Abbreviations for Meter directives                        23
  70.         5.3 Counting rules                                            24
  71.              5.3.1 Counting rules for hit-metering                    24
  72.              5.3.2 Counting rules for usage-limiting                  25
  73.              5.3.3 Equivalent algorithms are allowed                  26
  74.         5.4 Counting rules: interaction with Range requests           27
  75.         5.5 Implementation by non-caching proxies                     27
  76.         5.6 Implementation by cooperating caches                      28
  77.    6 Examples                                                         28
  78.         6.1 Example of a complete set of exchanges                    28
  79.         6.2 Protecting against HTTP/1.0 proxies                       30
  80.         6.3 More elaborate examples                                   30
  81.    7 Interactions with content negotiation                            31
  82.         7.1 Treatment of responses carrying a Vary header             31
  83.         7.2 Interaction with Transparent Content Negotiation          32
  84.    8 A Note on Capturing Referrals                                    32
  85.    9 Alternative proposals                                            33
  86.    10 Security Considerations                                         34
  87.    11 Acknowledgments                                                 35
  88.    12 References                                                      35
  89.    13 Authors' Addresses                                              36
  90.    14 Full Copyright Statement                                        37
  91.  
  92. 1 Introduction
  93.  
  94.    For a variety of reasons, content providers want to be able to
  95.    collect information on the frequency with which their content is
  96.    accessed. This desire leads to some of the "cache-busting" done by
  97.    existing servers.  ("Cache-busting" is the use by servers of
  98.    techniques intended to prevent caching of responses; it is unknown
  99.    exactly how common this is.)  This kind of cache-busting is done not
  100.    for the purpose of maintaining transparency or security properties,
  101.    but simply to collect demographic information.  Some cache-busting is
  102.    also done to provide different advertising images to appear on the
  103.    same page (i.e., each retrieval of the page sees a different ad).
  104.  
  105.    This proposal supports a model similar to that of publishers of
  106.    hard-copy publications: such publishers (try to) report to their
  107.    advertisers how many people read an issue of a publication at least
  108.    once; they don't (try to) report how many times a reader re-reads an
  109.    issue. They do this by counting copies published, and then try to
  110.    estimate, for their publication, on average how many people read a
  111.  
  112.  
  113.  
  114. Mogul & Leach               Standards Track                     [Page 2]
  115.  
  116. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  117.  
  118.  
  119.    single copy at least once. The key point is that the results aren't
  120.    exact, but are still useful. Another model is that of coding
  121.    inquiries in such a way that the advertiser can tell which
  122.    publication produced the inquiry.
  123.  
  124. 1.1 Goals, non-goals, and limitations
  125.  
  126.    HTTP/1.1 already allows origin servers to prevent caching of
  127.    responses, and evidence exists [9] that at least some of the time,
  128.    this is being done for the sole purpose of collecting counts of the
  129.    number of accesses of specific pages.  Some of this evidence is
  130.    inferred from the study of proxy traces; some is based on explicit
  131.    statements of the intention of the operators of Web servers.
  132.    Information collected this way might or might not be of actual use to
  133.    the people who collect it; the fact is that they want to collect it,
  134.    or already do so.
  135.  
  136.    The goal of this proposal is to provide an optional performance
  137.    optimization for this use of HTTP/1.1.
  138.  
  139.    This specification is:
  140.  
  141.       - Optional: no server or proxy is required to implement it.
  142.  
  143.       - Proxy-centered: there is no involvement on the part of
  144.         end-client implementations.
  145.  
  146.       - Solely a performance optimization: it provides no
  147.         information or functionality that is not already available
  148.         in HTTP/1.1.  The intent is to improve performance overall,
  149.         and reduce latency for almost all interactions; latency
  150.         might be increased for a small fraction of HTTP
  151.         interactions.
  152.  
  153.       - Best-efforts: it does not guarantee the accuracy of the
  154.         reported information, although it does provide accurate
  155.         results in the absence of persistent network failures or
  156.         host crashes.
  157.  
  158.       - Neutral with respect to privacy: it reveals to servers no
  159.         information about clients that is not already available
  160.         through the existing features of HTTP/1.1.
  161.  
  162.    The goals of this specification do not include:
  163.  
  164.       - Solving the entire problem of efficiently obtaining
  165.         extensive information about requests made via proxies.
  166.  
  167.  
  168.  
  169.  
  170. Mogul & Leach               Standards Track                     [Page 3]
  171.  
  172. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  173.  
  174.  
  175.       - Improving the protection of user privacy (although our
  176.         proposal may reduce the transfer of user-specific
  177.         information to servers, it does not prevent it).
  178.  
  179.       - Preventing or encouraging the use of log-exchange
  180.         mechanisms.
  181.  
  182.       - Avoiding all forms of "cache-busting", or even all
  183.         cache-busting done for gathering counts.
  184.  
  185.    This design has certain potential limitations:
  186.  
  187.       - If it is not deployed widely in both proxies and servers,
  188.         it will provide little benefit.
  189.  
  190.       - It may, by partially solving the hit-counting problem,
  191.         reduce the pressure to adopt more complete solutions, if
  192.         any become available.
  193.  
  194.       - Even if widely deployed, it might not be widely used, and
  195.         so might not significantly improve performance.
  196.  
  197.    These potential limitations might not be problems in actual practice.
  198.  
  199. 1.2 Brief summary of the design
  200.  
  201.    This section is included for people not wishing to read the entire
  202.    document; it is not a specification for the proposed design, and
  203.    over-simplifies many aspects of the design.
  204.  
  205.    The goal of this design is to eliminate the need for origin servers
  206.    to use "cache-busting" techniques, when this is done just for the
  207.    purpose of counting the number of users of a resource.  (Cache-
  208.    busting includes techniques such as setting immediate Expiration
  209.    dates, or sending "Cache-control:  private" in each response.)
  210.  
  211.    The design adds a new "Meter" header to HTTP; the header is always
  212.    protected by the "Connection" header, and so is always hop-by-hop.
  213.    This mechanism allows the construction of a "metering subtree", which
  214.    is a connected subtree of proxies, rooted at an origin server.  Only
  215.    those proxies that explicitly volunteer to join in the metering
  216.    subtree for a resource participate in hit-metering, but those proxies
  217.    that do volunteer are required to make their best effort to provide
  218.    accurate counts.  When a hit-metered response is forwarded outside of
  219.    the metering subtree, the forwarding proxy adds "Cache-control: s-
  220.    maxage=0", so that other proxies (outside the metering subtree) are
  221.    forced to forward all requests to a server in the metering subtree.
  222.  
  223.  
  224.  
  225.  
  226. Mogul & Leach               Standards Track                     [Page 4]
  227.  
  228. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  229.  
  230.  
  231.       NOTE: the HTTP/1.1 specification does not currently define a "s-
  232.       maxage" Cache-control directive.  The HTTP working group has
  233.       decided to add such a directive to the next revision of the
  234.       HTTP/1.1 specification [7].
  235.  
  236.    The Meter header carries zero or more directives, similar to the way
  237.    that the Cache-control header carries directives.  Proxies may use
  238.    certain Meter directives to volunteer to do hit-metering for a
  239.    resource.  If a proxy does volunteer, the server may use certain
  240.    directives to require that a response be hit-metered.  Finally,
  241.    proxies use a "count" Meter directive to report the accumulated hit
  242.    counts.
  243.  
  244.    The Meter mechanism can also be used by a server to limit the number
  245.    of uses that a cache may make of a cached response, before
  246.    revalidating it.
  247.  
  248.    The full specification includes complete rules for counting "uses" of
  249.    a response (e.g., non-conditional GETs) and "reuses" (conditional
  250.    GETs).  These rules ensure that the results are entirely consistent
  251.    in all cases, except when systems or networks fail.
  252.  
  253. 1.3 Terminology
  254.  
  255.    This document uses terms defined and explained in the HTTP/1.1
  256.    specification [4], including "origin server," "resource," "hop-by-
  257.    hop," "unconditional GET," and "conditional GET."  The reader is
  258.    expected to be familiar with the HTTP/1.1 specification and its
  259.    terminology.
  260.  
  261.    The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", SHOULD NOT",
  262.    "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be
  263.    interpreted as described in RFC 2119 [1].
  264.  
  265. 2 Overview
  266.  
  267.    The design described in this document introduces several new features
  268.    to HTTP:
  269.  
  270.       - Hit-metering: allows an origin server to obtain reasonably
  271.         accurate counts of the number of clients using a resource
  272.         instance via a proxy cache, or a hierarchy of proxy caches.
  273.  
  274.       - Usage-limiting: allows an origin server to control the
  275.         number of times a cached response may be used by a proxy
  276.         cache, or a hierarchy of proxy caches, before revalidation
  277.         with the origin server.
  278.  
  279.  
  280.  
  281.  
  282. Mogul & Leach               Standards Track                     [Page 5]
  283.  
  284. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  285.  
  286.  
  287.    These new non-mandatory features require minimal new protocol
  288.    support, no change in protocol version, relatively little overhead in
  289.    message headers.  The design adds no additional network round-trips
  290.    in any critical path that directly affects user-perceived latency
  291.    (see section 4.3 for an analysis).
  292.  
  293.    The primary goal of hit-metering and usage-limiting is to obviate the
  294.    need for an origin server to send "Cache-control: s-maxage=0" with
  295.    responses for resources whose value is not likely to change
  296.    immediately.  In other words, in cases where the only reason for
  297.    contacting the origin server on every request that might otherwise be
  298.    satisfied by a proxy cache entry is to allow the server to collect
  299.    demographic information or to control the number of times a cache
  300.    entry is used, the extension proposed here will avoid a significant
  301.    amount of unnecessary network traffic and latency.
  302.  
  303.    This design introduces one new "Meter" header, which is used both in
  304.    HTTP request messages and HTTP response messages.  The Meter header
  305.    is used to transmit a number of directives and reports.  In
  306.    particular, all negotiation of the use of hit-metering and usage
  307.    limits is done using this header.  No other changes to the existing
  308.    HTTP/1.1 specification [4] are proposed in this document.
  309.  
  310.    This design also introduces several new concepts:
  311.  
  312.       1. The concepts of a "use" of a cache entry, which is when a
  313.          proxy returns its entity-body in response to a conditional
  314.          or non-conditional request, and the "reuse" of a cache
  315.          entry, which is when a proxy returns a 304 (Not Modified)
  316.          response to a conditional request which is satisfied by
  317.          that cache entry.
  318.  
  319.       2. The concept of a hit-metered resource, for which proxy
  320.          caches make a best-effort attempt to report accurate
  321.          counts of uses and/or reuses to the origin server.
  322.  
  323.       3. The concept of a usage-limited resource, for which the
  324.          origin server expects proxy caches to limit the number of
  325.          uses and/or reuses.
  326.  
  327.    The new Meter directives and reports interact to allow proxy caches
  328.    and servers to cooperate in the collection of demographic data.  The
  329.    goal is a best-efforts approximation of the true number of uses
  330.    and/or reuses, not a guaranteed exact count.
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Mogul & Leach               Standards Track                     [Page 6]
  339.  
  340. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  341.  
  342.  
  343.    The new Meter directives also allow a server to bound the inaccuracy
  344.    of a particular hit-count, by bounding the number of uses between
  345.    reports.  It can also, for example, bound the number of times the
  346.    same ad is shown because of caching.
  347.  
  348.    Section 7.1 describes a way to use server-driven content negotiation
  349.    (the Vary header) that allows an HTTP origin server to flexibly
  350.    separate requests into categories and count requests by category.
  351.    Implementation of such a categorized hit counting is likely to be a
  352.    very small modification to most implementations of Vary; some
  353.    implementations may not require any modification at all.
  354.  
  355. 2.1 Discussion
  356.  
  357.    Mapping this onto the publishing model, a proxy cache would increment
  358.    the use-count for a cache entry once for each unconditional GET done
  359.    for the entry, and once for each conditional GET that results in
  360.    sending a copy of the entry to update a client's invalid cached copy.
  361.    Conditional GETs that result in 304 (Not Modified) are not included
  362.    in the use-count, because they do not result in a new user seeing the
  363.    page, but instead signify a repeat view by a user that had seen it
  364.    before.  However, 304 responses are counted in the reuse-count.
  365.    HEADs are not counted at all, because their responses do not contain
  366.    an entity-body.
  367.  
  368.    The Meter directives apply only to shared proxy caches, not to end-
  369.    client (or other single-user) caches.  Single user caches should not
  370.    use Meter, because their hits will be automatically counted as a
  371.    result of the unconditional GET with which they first fetch the page,
  372.    from either the origin-server or from a proxy cache.  Their
  373.    subsequent conditional GETs do not result in a new user seeing the
  374.    page.
  375.  
  376.    The mechanism specified here counts GETs; other methods either do not
  377.    result in a page for the user to read, aren't cached, or are
  378.    "written-through" and so can be directly counted by the origin
  379.    server. (If, in the future, a "cachable POST" came into existence,
  380.    whereby the entity-body in the POST request was used to select a
  381.    cached response, then such POSTs would have to be treated just like
  382.    GETs.)  The applicability of hit-metering to any new HTTP methods
  383.    that might be defined in the future is currently unspecifiable.
  384.  
  385.    In the case of multiple caches along a path, a proxy cache does the
  386.    obvious summation when it receives a use-count or reuse-count in a
  387.    request from another cache.
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Mogul & Leach               Standards Track                     [Page 7]
  395.  
  396. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  397.  
  398.  
  399. 3 Design concepts
  400.  
  401.    In order to allow the introduction of hit-metering and usage-limiting
  402.    without requiring a protocol revision, and to ensure a reasonably
  403.    close approximation of accurate counts, the negotiation of metering
  404.    and usage-limiting is done hop-by-hop, not end-to-end.  If one
  405.    considers the "tree" of proxies that receive, store, and forward a
  406.    specific response, the intent of this design is that within some
  407.    (possibly null) "metering subtree", rooted at the origin server, all
  408.    proxies are using the hit-metering and/or usage-limiting requested by
  409.    the origin server.
  410.  
  411.    Proxies at the leaves of this subtree will insert a "Cache-control:
  412.    s-maxage=0" directive, which forces all other proxies (below this
  413.    subtree) to check with a leaf of the metering subtree on every
  414.    request.  However, it does not prevent them from storing and using
  415.    the response, if the revalidation succeeds.
  416.  
  417.    No proxy is required to implement hit-metering or usage-limiting.
  418.    However, any proxy that transmits the Meter header in a request MUST
  419.    implement every unconditional requirement of this specification,
  420.    without exception or amendment.
  421.  
  422.    This is a conservative design, which may sometimes fail to take
  423.    advantage of hit-metering support in proxies outside the metering
  424.    subtree.  However, it is likely that without the reliability offered
  425.    by a conservative design, managers of origin servers with
  426.    requirements for accurate approximations will not take advantage of
  427.    any hit-metering proposal.
  428.  
  429.    The hit-metering/usage-limiting mechanism is designed to avoid any
  430.    extra network round-trips in the critical path of any client request,
  431.    and (as much as possible) to avoid excessively lengthening HTTP
  432.    messages.
  433.  
  434.    The Meter header is used to transmit both negotiation information and
  435.    numeric information.
  436.  
  437.    A formal specification for the Meter header appears in section 5; the
  438.    following discussion uses an informal approach to improve clarity.
  439.  
  440. 3.1 Implementation of the "metering subtree"
  441.  
  442.    The "metering subtree" approach is implemented in a simple,
  443.    straightforward way by defining the new "Meter" header as one that
  444.    MUST always be protected by a Connection header in every request or
  445.    response.  I.e., if the Meter header is present in an HTTP message,
  446.    that message:
  447.  
  448.  
  449.  
  450. Mogul & Leach               Standards Track                     [Page 8]
  451.  
  452. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  453.  
  454.  
  455.       1. MUST contain "Connection: meter", and MUST be handled
  456.          according to the HTTP/1.1 specification of the Connection
  457.          header.
  458.  
  459.       2. MUST NOT be sent in response to a request from a client
  460.          whose version number is less than HTTP/1.1.
  461.  
  462.       3. MUST NOT be accepted from a client whose version number is
  463.          less than HTTP/1.1.
  464.  
  465.    The reason for the latter two restrictions is to protect against
  466.    proxies that might not properly implement the Connection header.
  467.    Otherwise, a subtree that includes an HTTP/1.0 proxy might
  468.    erroneously appear to be a metering subtree.
  469.  
  470.       Note: It appears that for the Connection header mechanism to
  471.       function correctly, a system receiving an HTTP/1.0 (or lower-
  472.       version) message that includes a Connection header must act as if
  473.       this header, and all of the headers it protects, ought to have
  474.       been removed from the message by an intermediate proxy.
  475.  
  476.       Although RFC2068 does not specifically require this behavior, it
  477.       appears to be implied.  Otherwise, one could not depend on the
  478.       stated property (section 14.10) that the protected options "MUST
  479.       NOT be communicated by proxies over further connections."  This
  480.       should probably be clarified in a subsequent draft of the HTTP/1.1
  481.       specification.
  482.  
  483.       This specification does not, in any way, propose a modification of
  484.       the specification of the Connection header.
  485.  
  486.    From the point of view of an origin server, the proxies in a metering
  487.    subtree work together to obey usage limits and to maintain accurate
  488.    usage counts.  When an origin server specifies a usage limit, a proxy
  489.    in the metering subtree may subdivide this limit among its children
  490.    in the subtree as it sees fit.  Similarly, when a proxy in the
  491.    subtree receives a usage report, it ensures that the hits represented
  492.    by this report are summed properly and reported to the origin server.
  493.  
  494.    When a proxy forwards a hit-metered or usage-limited response to a
  495.    client (proxy or end-client) not in the metering subtree, it MUST
  496.    omit the Meter header, and it MUST add "Cache-control: s-maxage=0" to
  497.    the response.
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506. Mogul & Leach               Standards Track                     [Page 9]
  507.  
  508. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  509.  
  510.  
  511. 3.2 Format of the Meter header
  512.  
  513.    The Meter header is used to carry zero or more directives.  Multiple
  514.    Meter headers may occur in an HTTP message, but according to the
  515.    rules in section 4.2 of the HTTP/1.1 specification [4], they may be
  516.    combined into a single header (and should be so combined, to reduce
  517.    overhead).
  518.  
  519.    For example, the following sequence of Meter headers
  520.  
  521.        Meter: max-uses=3
  522.        Meter: max-reuses=10
  523.        Meter: do-report
  524.  
  525.    may be expressed as
  526.  
  527.        Meter: max-uses=3, max-reuses=10, do-report
  528.  
  529. 3.3 Negotiation of hit-metering and usage-limiting
  530.  
  531.    An origin server that wants to collect hit counts for a resource, by
  532.    simply forcing all requests to bypass any proxy caches, would respond
  533.    to requests on the resource with "Cache-control: s-maxage=0".  (An
  534.    origin server wishing to prevent HTTP/1.0 proxies from improperly
  535.    caching the response could also send both "Expires: <now>", to
  536.    prevent such caching, and "Cache-control: max-age=NNNN", to allow
  537.    newer proxies to cache the response).
  538.  
  539.    The purpose of the Meter header is to obviate the need for "Cache-
  540.    control: s-maxage=0" within a metering subtree.  Thus, any proxy may
  541.    negotiate the use of hit-metering and/or usage-limiting with the
  542.    next-hop server.  If this server is the origin server, or is already
  543.    part of a metering subtree (rooted at the origin server), then it may
  544.    complete the negotiation, thereby extending the metering subtree to
  545.    include the new proxy.
  546.  
  547.    To start the negotiation, a proxy sends its request with one of the
  548.    following Meter directives:
  549.  
  550.    will-report-and-limit
  551.                    indicates that the proxy is willing and able to
  552.                    return usage reports and will obey any usage-limits.
  553.  
  554.    wont-report     indicates that the proxy will obey usage-limits but
  555.                    will not send usage reports.
  556.  
  557.    wont-limit      indicates that the proxy will not obey usage-limits
  558.                    but will send usage reports.
  559.  
  560.  
  561.  
  562. Mogul & Leach               Standards Track                    [Page 10]
  563.  
  564. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  565.  
  566.  
  567.    A proxy willing to neither obey usage-limits nor send usage reports
  568.    MUST NOT transmit a Meter header in the request.
  569.  
  570.    By definition, an empty Meter header:
  571.  
  572.        Meter:
  573.  
  574.    is equivalent to "Meter: will-report-and-limit", and so, by the
  575.    definition of the Connection header (see section 14.10 of the
  576.    HTTP/1.1 specification [4]), a request that contains
  577.  
  578.        Connection: Meter
  579.  
  580.    and no explicit Meter header is equivalent to a request that contains
  581.  
  582.        Connection: Meter
  583.        Meter: will-report-and-limit
  584.  
  585.    This makes the default case more efficient.
  586.  
  587.    An origin server that is not interested in metering or usage-limiting
  588.    the requested resource simply ignores the Meter header.
  589.  
  590.    If the server wants the proxy to do hit-metering and/or usage-
  591.    limiting, its response should include one or more of the following
  592.    Meter directives:
  593.  
  594.    For hit-metering:
  595.  
  596.    do-report       specifies that the proxy MUST send usage reports to
  597.                    the server.
  598.  
  599.    dont-report     specifies that the proxy SHOULD NOT send usage
  600.                    reports to the server.
  601.  
  602.    timeout=NNN     sets a metering timeout of NNN minutes, from the time
  603.                    that this response was originated, for the reporting
  604.                    of a hit-count.  If the proxy has a non-zero hit
  605.                    count for this response when the timeout expires, it
  606.                    MUST send a report to the server at or before that
  607.                    time.  Implies "do-report".
  608.  
  609.    By definition, an empty Meter header in a response, or any Meter
  610.    header that does not contain "dont-report", means "Meter: do-report";
  611.    this makes a common case more efficient.
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618. Mogul & Leach               Standards Track                    [Page 11]
  619.  
  620. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  621.  
  622.  
  623.       Note: an origin server using the metering timeout mechanism to
  624.       bound the collection period over which hit-counts are obtained
  625.       should adjust the timeout values in the responses it sends so that
  626.       all responses generated within that period reach their metering
  627.       timeouts at or before the end of that period.
  628.  
  629.       If the origin server simply sends a constant metering timeout T
  630.       with each response for a resource, the reports that it receives
  631.       will reflect activity over a period whose duration is between T
  632.       and N*T (in the worst case), where N is the maximum depth of the
  633.       metering subtree.
  634.  
  635.    For usage-limiting
  636.  
  637.    max-uses=NNN    sets an upper limit of NNN "uses" of the response,
  638.                    not counting its immediate forwarding to the
  639.                    requesting end-client, for all proxies in the
  640.                    following subtree taken together.
  641.  
  642.    max-reuses=NNN  sets an upper limit of NNN "reuses" of the response
  643.                    for all proxies in the following subtree taken
  644.                    together.
  645.  
  646.    When a proxy has exhausted its allocation of "uses" or "reuses" for a
  647.    cache entry, it MUST revalidate the cache entry (using a conditional
  648.    request) before returning it in a response.  (The proxy SHOULD use
  649.    this revalidation message to send a usage report, if one was
  650.    requested and it is time to send it.  See sections 3.4 and 3.5.)
  651.  
  652.    These Meter response-directives apply only to the specific response
  653.    that they are attached to.
  654.  
  655.       Note that the limit on "uses" set by the max-uses directive does
  656.       not include the use of the response to satisfy the end-client
  657.       request that caused the proxy's request to the server.  This
  658.       counting rule supports the notion of a cache-initiated prefetch: a
  659.       cache may issue a prefetch request, receive a max-uses=0 response,
  660.       store that response, and then return that response (without
  661.       revalidation) when a client makes an actual request for the
  662.       resource.  However, each such response may be used at most once in
  663.       this way, so the origin server maintains precise control over the
  664.       number of actual uses.
  665.  
  666.    A server MUST NOT send a Meter header that would require a proxy to
  667.    do something that it has not yet offered to do.  A proxy receiving a
  668.    Meter response-directive asking the proxy to do something it did not
  669.    volunteer to do SHOULD ignore that directive.
  670.  
  671.  
  672.  
  673.  
  674. Mogul & Leach               Standards Track                    [Page 12]
  675.  
  676. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  677.  
  678.  
  679.    A proxy receiving a Meter header in a response MUST either obey it,
  680.    or it MUST revalidate the corresponding cache entry on every access.
  681.    (I.e., if it chooses not to obey the Meter header in a response, it
  682.    MUST act as if the response included "Cache-control:  s-maxage=0".)
  683.  
  684.       Note: a proxy that has not sent the Meter header in a request for
  685.       the given resource, and which has therefore not volunteered to
  686.       honor Meter directives in a response, is not required to honor
  687.       them.  If, in this situation, the server does send a Meter header
  688.       in a response, this is a protocol error.  However, based on the
  689.       robustness principle, the proxy may choose to interpret the Meter
  690.       header as an implicit request to include "Cache-control: s-
  691.       maxage=0" when it forwards the response, since this preserves the
  692.       apparent intention of the server.
  693.  
  694.    A proxy that receives the Meter header in a request may ignore it
  695.    only to the extent that this is consistent with its own duty to the
  696.    next-hop server.  If the received Meter request header is
  697.    inconsistent with that duty, or if no Meter request header is
  698.    received and the response from the next-hop server requests any form
  699.    of metering or limiting, then the proxy MUST add "Cache-control: s-
  700.    maxage=0" to any response it forwards for that request.  (A proxy
  701.    SHOULD NOT add or change the Expires header or max-age Cache-control
  702.    directive.)
  703.  
  704.       For example, if proxy A receives a GET request from proxy B for
  705.       URL X with "Connection: Meter", but proxy A's cached response for
  706.       URL does not include any Meter directives, then proxy A may ignore
  707.       the metering offer from proxy B.
  708.  
  709.       However, if proxy A has previously told the origin server "Meter:
  710.       wont-limit" (implying will-report), and the cached response
  711.       contains "Meter: do-report", and proxy B's request includes
  712.       "Meter:  wont-report", then proxy B's offer is inconsistent with
  713.       proxy A's duty to the origin server.  Therefore, in this case
  714.       proxy A must add "Cache-control: s-maxage=0" when it returns the
  715.       cached response to proxy B, and must not include a Meter header in
  716.       this response.
  717.  
  718.    If a server does not want to use the Meter mechanism, and will not
  719.    want to use it any time soon, it may send this directive:
  720.  
  721.    wont-ask        recommends that the proxy SHOULD NOT send any Meter
  722.                    directives to this server.
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730. Mogul & Leach               Standards Track                    [Page 13]
  731.  
  732. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  733.  
  734.  
  735.    The proxy SHOULD remember this fact for up to 24 hours.  This avoids
  736.    virtually all unnecessary overheads for servers that do not wish to
  737.    use or support the Meter header.  (This directive also implies
  738.    "dont-report".)
  739.  
  740. 3.4 Transmission of usage reports
  741.  
  742.    To transmit a usage report, a proxy sends the following Meter header
  743.    in a request on the appropriate resource:
  744.  
  745.        Meter: count=NNN/MMM
  746.  
  747.    The first integer indicates the count of uses of the cache entry
  748.    since the last report; the second integer indicates the count of
  749.    reuses of the entry (see section 5.3 for rules on counting uses and
  750.    reuses).  The transmission of a "count" directive in a request with
  751.    no other Meter directive is also defined as an implicit transmission
  752.    of a "will-report-and-limit" directive, to optimize the common case.
  753.    (A proxy not willing to honor usage-limits would send "Meter:
  754.    count=NNN/MMM, wont-limit" for its reports.)
  755.  
  756.    Note that when a proxy forwards a client's request and receives a
  757.    response, the response that the proxy sends immediately to the
  758.    requesting client is not counted as a "use".  I.e., the reported
  759.    count is the number of times the cache entry was used, and not the
  760.    number of times that the response was used.
  761.  
  762.    A proxy SHOULD NOT transmit "Meter: count=0/0", since this conveys no
  763.    useful information.
  764.  
  765.    Usage reports MUST always be transmitted as part of a conditional
  766.    request (such as a GET or HEAD), since the information in the
  767.    conditional header (e.g., If-Modified-Since or If-None-Match) is
  768.    required for the origin server to know which instance of a resource
  769.    is being counted.  Proxys forwarding usage reports up the metering
  770.    subtree MUST NOT change the contents of the conditional header, since
  771.    otherwise this would result in incorrect counting.
  772.  
  773.    A usage report MUST NOT be transmitted as part of a forwarded request
  774.    that includes multiple entity tags in an If-None-Match or If-Match
  775.    header.
  776.  
  777.       Note: a proxy that offers its willingness to do hit-metering
  778.       (report usage) must count both uses and reuses.  It is not
  779.       possible to negotiate the reporting of one but not the other.
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786. Mogul & Leach               Standards Track                    [Page 14]
  787.  
  788. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  789.  
  790.  
  791. 3.5 When to send usage reports
  792.  
  793.    A proxy that has offered to send usage reports to its parent in the
  794.    metering subtree MUST send a usage report in each of these
  795.    situations:
  796.  
  797.       1. When it forwards a conditional GET on the resource
  798.          instance on behalf of one of its clients (if the GET is
  799.          conditional on at most one entity-tag).
  800.  
  801.       2. When it forwards a conditional HEAD on the resource
  802.          instance on behalf of one of its clients.
  803.  
  804.       3. When it must generate a conditional GET to satisfy a
  805.          client request because the max-uses limit has been
  806.          exceeded.
  807.  
  808.       4. Upon expiration of a metering timeout associated with a
  809.          cache entry that has a non-zero hit-count.
  810.  
  811.       5. When it removes the corresponding non-zero hit-count entry
  812.          from its storage for any reason including:
  813.  
  814.             - the proxy needs the storage space for another
  815.               hit-count entry.
  816.  
  817.             - the proxy is not able to store more than one response
  818.               per resource, and a request forwarded on behalf of a
  819.               client has resulted in the receipt of a new response
  820.               (one with a different entity-tag or last-modified
  821.               time).
  822.  
  823.          Note that a cache might continue to store hit-count information
  824.          even after having deleted the body of the response, so it is
  825.          not necessary to report the hit-count when deleting the body;
  826.          it is only necessary to report it if the proxy is about to
  827.          "forget" a non-zero value.
  828.  
  829.    (Section 5.3 explains how hit-counts become zero or non-zero.)
  830.  
  831.    If the usage report is being sent because the proxy is about to
  832.    remove the hit-count entry from its storage, or because of an expired
  833.    metering timeout:
  834.  
  835.       - The proxy MUST send the report as part of a conditional
  836.         HEAD request on the resource instance.
  837.  
  838.  
  839.  
  840.  
  841.  
  842. Mogul & Leach               Standards Track                    [Page 15]
  843.  
  844. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  845.  
  846.  
  847.       - The proxy is not required to retry the HEAD request if it
  848.         fails (this is a best-efforts design).  To improve
  849.         accuracy, however, the proxy SHOULD retry failed HEAD
  850.         requests, subject to resource constraints.
  851.  
  852.       - The proxy is not required to serialize any other operation
  853.         on the completion of this request.
  854.  
  855.       Note: proxy implementors are strongly encouraged to batch several
  856.       HEAD-based reports to the same server, when possible, over a
  857.       single persistent connection, to reduce network overhead as much
  858.       as possible.  This may involve a non-naive algorithm for
  859.       scheduling the deletion of hit-count entries.
  860.  
  861.    If the usage count is sent because of an arriving request that also
  862.    carries a "count" directive, the proxy MUST combine its own (possibly
  863.    zero) use and reuse counts with the arriving counts, and then attempt
  864.    to forward the request.
  865.  
  866.    However, the proxy is not required to forward an arriving request
  867.    with a "count" directive, provided that:
  868.  
  869.       - it can reply to the request using a cached response, in
  870.         compliance with other requirements of the HTTP
  871.         specification.
  872.  
  873.       - such a response does not exceed a max-uses limit.
  874.  
  875.       - it is not required to forward the request because of an
  876.         expired metering timeout.
  877.  
  878.    If an arriving request carries a "count" directive, and the proxy no
  879.    longer has a cache entry for the resource, the proxy MUST forward the
  880.    "count" directive.  (This is, in any case, what a proxy without a
  881.    suitable cache entry would normally do for any valid request it
  882.    receives.)
  883.  
  884. 3.6 Subdivision of usage-limits
  885.  
  886.    When an origin server specifies a usage limit, a proxy in the
  887.    metering subtree may subdivide this limit among its children in the
  888.    subtree as it sees fit.
  889.  
  890.    For example, consider the situation with two proxies P1 and P2, each
  891.    of which uses proxy P3 as a way to reach origin server S. Imagine
  892.    that S sends P3 a response with
  893.  
  894.  
  895.  
  896.  
  897.  
  898. Mogul & Leach               Standards Track                    [Page 16]
  899.  
  900. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  901.  
  902.  
  903.        Meter: max-uses=10
  904.  
  905.    The proxies use that response to satisfy the current requesting end-
  906.    client.  The max-uses directive in this example allows the
  907.    combination of P1, P2, and P3 together to satisfy 10 additional end-
  908.    client uses (unconditional GETs) for the resource.
  909.  
  910.    This specification does not constrain how P3 divides up that
  911.    allocation among itself and the other proxies.  For example, P3 could
  912.    retain all of max-use allocation for itself.  In that case, it would
  913.    forward the response to P1 and/or P2 with
  914.  
  915.        Meter: max-uses=0
  916.  
  917.    P3 might also divide the allocation equally among P1 and P2,
  918.    retaining none for itself (which may be the right choice if P3 has
  919.    few or no other clients).  In this case, it could send
  920.  
  921.        Meter: max-uses=5
  922.  
  923.    to the proxy (P1 or P2) that made the initial request, and then
  924.    record in some internal data structure that it "owes" the other proxy
  925.    the rest of the allocation.
  926.  
  927.    Note that this freedom to choose the max-uses value applies to the
  928.    origin server, as well.  There is no requirement that an origin
  929.    server send the same max-uses value to all caches.  For example, it
  930.    might make sense to send "max-uses=2" the first time one hears from a
  931.    cache, and then double the value (up to some maximum limit) each time
  932.    one gets a "use-count" from that cache.  The idea is that the faster
  933.    a cache is using up its max-use quota, the more likely it will be to
  934.    report a use-count value before removing the cache entry.  Also, high
  935.    and frequent use-counts imply a corresponding high efficiency benefit
  936.    from allowing caching.
  937.  
  938.    Again, the details of such heuristics would be outside the scope of
  939.    this specification.
  940.  
  941. 4 Analysis
  942.  
  943.    This section includes informal analyses of several aspects of hit-
  944.    metering:
  945.  
  946.       1. the accuracy of results when applied to counting users
  947.          (section 4.1).
  948.  
  949.       2. the problem of counting users whose browsers do not
  950.          include caches, such as Network Computers (section 4.2).
  951.  
  952.  
  953.  
  954. Mogul & Leach               Standards Track                    [Page 17]
  955.  
  956. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  957.  
  958.  
  959.       3. delays imposed on "critical paths" for HTTP operations
  960.          (section 4.3).
  961.  
  962. 4.1 Approximation accuracy for counting users
  963.  
  964.    For many (but not all) service operators, the single most important
  965.    aspect of the request stream is the number of distinct users who have
  966.    retrieved a particular entity within a given period (e.g., during a
  967.    given day).  The hit-metering mechanism is designed to provide an
  968.    origin server with an approximation of the number of users that
  969.    reference a given resource.  The intent of the design is that the
  970.    precision of this approximation is consistent with the goals of
  971.    simplicity and optional implementation.
  972.  
  973.    Almost all Web users use client software that maintains local caches,
  974.    and the state of the art of local-caching technology is quite
  975.    effective.  (Section 4.2 discusses the case where end-client caches
  976.    are small or non-existent.)  Therefore, assuming an effective and
  977.    persistent end-client cache, each individual user who retrieves an
  978.    entity does exactly one GET request that results in a 200 or 203
  979.    response, or a 206 response that includes the first byte of the
  980.    entity. If a proxy cache maintains and reports an accurate use-count
  981.    of such retrievals, then its reported use-count will closely
  982.    approximate the number of distinct users who have retrieved the
  983.    entity.
  984.  
  985.    There are some circumstances under which this approximation can break
  986.    down.  For example, if an entity stays in a proxy cache for much
  987.    longer than it persists in the typical client cache, and users often
  988.    re-reference the entity, then this scheme will tend to over-count the
  989.    number of users. Or, if the cache-management policy implemented in
  990.    typical client caches is biased against retaining certain kinds of
  991.    frequently re-referenced entities (such as very large images), the
  992.    use-counts reported will tend to overestimate the user-counts for
  993.    such entities.
  994.  
  995.    Browser log analysis has shown that when a user revisits a resource,
  996.    this is almost always done very soon after the previous visit, almost
  997.    always with fewer than eight intervening references [11].  Although
  998.    this result might not apply universally, it implies that almost all
  999.    reuses will hit in the end-client cache, and will not be seen as
  1000.    unconditional GETs by a proxy cache.
  1001.  
  1002.    The existing (HTTP/1.0) "cache-busting" mechanisms for counting
  1003.    distinct users will certainly overestimate the number of users behind
  1004.    a proxy, since it provides no reliable way to distinguish between a
  1005.    user's initial request and subsequent repeat requests that might have
  1006.    been conditional GETs, had not cache-busting been employed.  The
  1007.  
  1008.  
  1009.  
  1010. Mogul & Leach               Standards Track                    [Page 18]
  1011.  
  1012. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1013.  
  1014.  
  1015.    "Cache-control: s-maxage=0" feature of HTTP/1.1 does allow the
  1016.    separation of use-counts and reuse-counts, provided that no HTTP/1.0
  1017.    proxy caches intervene.
  1018.  
  1019.    Note that if there is doubt about the validity of the results of
  1020.    hit-metering a given set of resources, the server can employ cache-
  1021.    busting techniques for short periods, to establish a baseline for
  1022.    validating the hit-metering results.  Various approaches to this
  1023.    problem are discussed in a paper by James Pitkow [9].
  1024.  
  1025. 4.2 What about "Network Computers"?
  1026.  
  1027.    The analysis in section 4.1 assumed that "almost all Web users" have
  1028.    client caches.  If the Network Computers (NC) model becomes popular,
  1029.    however, then this assumption may be faulty: most proposed NCs have
  1030.    no disk storage, and relatively little RAM.  Many Personal Digital
  1031.    Assistants (PDAs), which sometimes have network access, have similar
  1032.    constraints.  Such client systems may do little or no caching of HTTP
  1033.    responses.  This means that a single user might well generate many
  1034.    unconditional GETs that yield the same response from a proxy cache.
  1035.  
  1036.    First note that the hit-metering design in this document, even with
  1037.    such clients, provides an approximation no worse than available with
  1038.    unmodified HTTP/1.1: the counts that a proxy would return to an
  1039.    origin server would represent exactly the number of requests that the
  1040.    proxy would forward to the server, if the server simply specifies
  1041.    "Cache-control:  s-maxage=0".
  1042.  
  1043.    However, it may be possible to improve the accuracy of these hit-
  1044.    counts by use of some heuristics at the proxy.  For example, the
  1045.    proxy might note the IP address of the client, and count only one GET
  1046.    per client address per response.  This is not perfect: for example,
  1047.    it fails to distinguish between NCs and certain other kinds of hosts.
  1048.    The proxy might also use the heuristic that only those clients that
  1049.    never send a conditional GET should be treated this way, although we
  1050.    are not at all certain that NCs will never send conditional GETs.
  1051.  
  1052.    Since the solution to this problem appears to require heuristics
  1053.    based on the actual behavior of NCs (or perhaps a new HTTP protocol
  1054.    feature that allows unambiguous detection of cacheless clients), it
  1055.    appears to be premature to specify a solution.
  1056.  
  1057. 4.3 Critical-path delay analysis
  1058.  
  1059.    In systems (such as the Web) where latency is at issue, there is
  1060.    usually a tree of steps which depend on one another, in such a way
  1061.    that the final result cannot be accomplished until all of its
  1062.    predecessors have been.  Since the tree structure admits some
  1063.  
  1064.  
  1065.  
  1066. Mogul & Leach               Standards Track                    [Page 19]
  1067.  
  1068. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1069.  
  1070.  
  1071.    parallelism, it is not necessary to add up the timings for each step
  1072.    to discover the latency for the entire process.  But any single path
  1073.    through this dependency tree cannot be parallelized, and the longest
  1074.    such path is the one whose length (in units of seconds) determines
  1075.    the overall latency.  This is the "critical path", because no matter
  1076.    how much shorter one makes any other path, that cannot change the
  1077.    overall latency for the final result.
  1078.  
  1079.    If one views the final result, for a Web request, as rendering a page
  1080.    at a browser, or otherwise acting on the result of a request, clearly
  1081.    some network round trips (e.g., exchanging TCP SYN packets if the
  1082.    connection doesn't already exist) are on the critical path.  This
  1083.    hit-metering design does add some round-trips for reporting non-zero
  1084.    counts when a cache entry is removed, but, by design, these are off
  1085.    any critical path:  they may be done in parallel with any other
  1086.    operation, and require only "best efforts", so a proxy does not have
  1087.    to serialize other operations with their success or failure.
  1088.  
  1089.    Clearly, anything that changes network utilization (either increasing
  1090.    or decreasing it) can indirectly affect user-perceived latency.  Our
  1091.    expectation is that hit-metering, on average, will reduce loading and
  1092.    so even its indirect effects should not add network round-trips in
  1093.    any critical path.  But there might be a few specific instances where
  1094.    the added non-critical-path operations (specifically, usage reports
  1095.    upon cache-entry removal) delay an operation on a critical path.
  1096.    This is an unavoidable problem in datagram networks.
  1097.  
  1098. 5 Specification
  1099.  
  1100. 5.1 Specification of Meter header and directives
  1101.  
  1102.    The Meter general-header field is used to:
  1103.  
  1104.       - Negotiate the use of hit-metering and usage-limiting among
  1105.         origin servers and proxy caches.
  1106.  
  1107.       - Report use counts and reuse counts.
  1108.  
  1109.    Implementation of the Meter header is optional for both proxies and
  1110.    origin servers.  However, any proxy that transmits the Meter header
  1111.    in a request MUST implement every requirement of this specification,
  1112.    without exception or amendment.
  1113.  
  1114.    The Meter header MUST always be protected by a Connection header.  A
  1115.    proxy that does not implement the Meter header MUST NOT pass it
  1116.    through to another system (see section 5.5 for how a non-caching
  1117.    proxy may comply with this specification).  If a Meter header is
  1118.  
  1119.  
  1120.  
  1121.  
  1122. Mogul & Leach               Standards Track                    [Page 20]
  1123.  
  1124. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1125.  
  1126.  
  1127.    received in a message whose version is less than HTTP/1.1, it MUST be
  1128.    ignored (because it has clearly flowed through a proxy that does not
  1129.    implement Meter).
  1130.  
  1131.    A proxy that has received a response with a version less than
  1132.    HTTP/1.1, and therefore from a server (or another proxy) that does
  1133.    not implement the Meter header, SHOULD NOT send Meter request
  1134.    directives to that server, because these would simply waste
  1135.    bandwidth.  This recommendation does not apply if the proxy is
  1136.    currently hit-metering or usage-limiting any responses from that
  1137.    server.  If the proxy receives a HTTP/1.1 or higher response from
  1138.    such a server, it should cease its suppression of the Meter
  1139.    directives.
  1140.  
  1141.    All proxies sending the Meter header MUST adhere to the "metering
  1142.    subtree" design described in section 3.
  1143.  
  1144.        Meter = "Meter" ":" 0#meter-directive
  1145.  
  1146.        meter-directive = meter-request-directive
  1147.                        | meter-response-directive
  1148.                        | meter-report-directive
  1149.  
  1150.        meter-request-directive =
  1151.                          "will-report-and-limit"
  1152.                        | "wont-report"
  1153.                        | "wont-limit"
  1154.  
  1155.        meter-report-directive =
  1156.                        | "count" "=" 1*DIGIT "/" 1*DIGIT
  1157.  
  1158.        meter-response-directive =
  1159.                          "max-uses" "=" 1*DIGIT
  1160.                        | "max-reuses" "=" 1*DIGIT
  1161.                        | "do-report"
  1162.                        | "dont-report"
  1163.                        | "timeout" "=" 1*DIGIT
  1164.                        | "wont-ask"
  1165.  
  1166.    A meter-request-directive or meter-report-directive may only appear
  1167.    in an HTTP request message.  A meter-response-directive may only
  1168.    appear in an HTTP response directive.
  1169.  
  1170.    An empty Meter header in a request means "Meter: will-report-and-
  1171.    limit".  An empty Meter header in a response, or any other response
  1172.    including one or more Meter headers without the "dont-report" or
  1173.    "wont-ask" directive, implies "Meter:  do-report".
  1174.  
  1175.  
  1176.  
  1177.  
  1178. Mogul & Leach               Standards Track                    [Page 21]
  1179.  
  1180. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1181.  
  1182.  
  1183.    The meaning of the meter-request-directives are as follows:
  1184.  
  1185.    will-report-and-limit
  1186.                    indicates that the proxy is willing and able to
  1187.                    return usage reports and will obey any usage-limits.
  1188.  
  1189.    wont-report     indicates that the proxy will obey usage-limits but
  1190.                    will not send usage reports.
  1191.  
  1192.    wont-limit      indicates that the proxy will not obey usage-limits
  1193.                    but will send usage reports.
  1194.  
  1195.    A proxy willing neither to obey usage-limits nor to send usage
  1196.    reports MUST NOT transmit a Meter header in the request.
  1197.  
  1198.    The meaning of the meter-report-directives are as follows:
  1199.  
  1200.    count "=" 1*DIGIT "/" 1*DIGIT
  1201.                    Both digit strings encode decimal integers.  The
  1202.                    first integer indicates the count of uses of the
  1203.                    cache entry since the last report; the second integer
  1204.                    indicates the count of reuses of the entry.
  1205.  
  1206.    Section 5.3 specifies the counting rules.
  1207.  
  1208.    The meaning of the meter-response-directives are as follows:
  1209.  
  1210.    max-uses "=" 1*DIGIT
  1211.                    sets an upper limit on the number of "uses" of the
  1212.                    response, not counting its immediate forwarding to
  1213.                    the requesting end-client, for all proxies in the
  1214.                    following subtree taken together.
  1215.  
  1216.    max-reuses "=" 1*DIGIT
  1217.                    sets an upper limit on the number of "reuses" of the
  1218.                    response for all proxies in the following subtree
  1219.                    taken together.
  1220.  
  1221.    do-report       specifies that the proxy MUST send usage reports to
  1222.                    the server.
  1223.  
  1224.    dont-report     specifies that the proxy SHOULD NOT send usage
  1225.                    reports to the server.
  1226.  
  1227.    timeout "=" 1*DIGIT
  1228.                    sets a metering timeout of the specified number of
  1229.                    minutes (not seconds) after the origination of this
  1230.                    response (as indicated by its "Date" header).  If the
  1231.  
  1232.  
  1233.  
  1234. Mogul & Leach               Standards Track                    [Page 22]
  1235.  
  1236. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1237.  
  1238.  
  1239.                    proxy has a non-zero hit count for this response when
  1240.                    the timeout expires, it MUST send a report to the
  1241.                    server at or before that time.  Timeouts should be
  1242.                    implemented with an accuracy of plus or minus one
  1243.                    minute.  Implies "do-report".
  1244.  
  1245.    wont-ask        specifies that the proxy SHOULD NOT send any Meter
  1246.                    headers to the server.  The proxy should forget this
  1247.                    advice after a period of no more than 24 hours.
  1248.  
  1249.    Section 5.3 specifies the counting rules, and in particular specifies
  1250.    a somewhat non-obvious interpretation of the max-uses value.
  1251.  
  1252. 5.2 Abbreviations for Meter directives
  1253.  
  1254.    To allow for the most efficient possible encoding of Meter headers,
  1255.    we define abbreviated forms of all Meter directives.  These are
  1256.    exactly semantically equivalent to their non-abbreviated
  1257.    counterparts.  All systems implementing the Meter header MUST
  1258.    implement both the abbreviated and non-abbreviated forms.
  1259.    Implementations SHOULD use the abbreviated forms in normal use.
  1260.  
  1261.    The abbreviated forms of Meter directive are shown below, with the
  1262.    corresponding non-abbreviated literals in the comments:
  1263.  
  1264.        Abb-Meter = "Meter" ":" 0#abb-meter-directive
  1265.  
  1266.        abb-meter-directive = abb-meter-request-directive
  1267.                        | abb-meter-response-directive
  1268.                        | abb-meter-report-directive
  1269.  
  1270.        abb-meter-request-directive =
  1271.                          "w"           ; "will-report-and-limit"
  1272.                        | "x"           ; "wont-report"
  1273.                        | "y"           ; "wont-limit"
  1274.  
  1275.        abb-meter-report-directive =
  1276.                        | "c" "=" 1*DIGIT "/" 1*DIGIT   ; "count"
  1277.  
  1278.        abb-meter-response-directive =
  1279.                          "u" "=" 1*DIGIT       ; "max-uses"
  1280.                        | "r" "=" 1*DIGIT       ; "max-reuses"
  1281.                        | "d"                   ; "do-report"
  1282.                        | "e"                   ; "dont-report"
  1283.                        | "t" "=" 1*DIGIT       ; "timeout"
  1284.                        | "n"                   ; "wont-ask"
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290. Mogul & Leach               Standards Track                    [Page 23]
  1291.  
  1292. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1293.  
  1294.  
  1295.       Note: although the Abb-Meter BNF rule is defined separately from
  1296.       the Meter rule, one may freely mix abbreviated and non-abbreviated
  1297.       Meter directives in the same header.
  1298.  
  1299. 5.3 Counting rules
  1300.  
  1301.       Note: please remember that hit-counts and usage-counts are
  1302.       associated with individual responses, not with resources.  A cache
  1303.       entry that, over its lifetime, holds more than one response is
  1304.       also not a "response", in this particular sense.
  1305.  
  1306.    Let R be a cached response, and V be the value of the Request-URI and
  1307.    selecting request-headers (if any, see section 14.43 of the HTTP/1.1
  1308.    specification [4]) that would select R if contained in a request.  We
  1309.    define a "use" of R as occurring when the proxy returns its stored
  1310.    copy of R in a response with any of the following status codes: a 200
  1311.    (OK) status; a 203 (Non-Authoritative Information) status; or a 206
  1312.    (Partial Content) status when the response contains byte #0 of the
  1313.    entity (see section 5.4 for a discussion of Range requests).
  1314.  
  1315.       Note: when a proxy forwards a client's request and receives a
  1316.       response, the response that the proxy sends immediately to the
  1317.       requesting client is not counted as a "use".  I.e., the reported
  1318.       count is the number of times the cache entry was used, and not the
  1319.       number of times that the response was used.
  1320.  
  1321.    We define a "reuse" of R as as occurring when the proxy responds to a
  1322.    request selecting R with a 304 (Not Modified) status, unless that
  1323.    request is a Range request that does not specify byte #0 of the
  1324.    entity.
  1325.  
  1326. 5.3.1 Counting rules for hit-metering
  1327.  
  1328.    A proxy participating in hit-metering for a cache response R
  1329.    maintains two counters, CU and CR, associated with R. When a proxy
  1330.    first stores R in its cache, it sets both CU and CR to 0 (zero).
  1331.    When a subsequent client request results in a "use" of R, the proxy
  1332.    increments CU.  When a subsequent client request results in a "reuse"
  1333.    of R, the proxy increments CR.  When a subsequent client request
  1334.    selecting R (i.e., including V) includes a "count" Meter directive,
  1335.    the proxy increments CU and CR using the corresponding values in the
  1336.    directive.
  1337.  
  1338.    When the proxy sends a request selecting R (i.e., including V) to the
  1339.    inbound server, it includes a "count" Meter directive with the
  1340.    current CU and CR as the parameter values.  If this request was
  1341.    caused by the proxy's receipt of a request from a client, upon
  1342.    receipt of the server's response, the proxy sets CU and CR to the
  1343.  
  1344.  
  1345.  
  1346. Mogul & Leach               Standards Track                    [Page 24]
  1347.  
  1348. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1349.  
  1350.  
  1351.    number of uses and reuses, respectively, that may have occurred while
  1352.    the request was in progress.  (These numbers are likely, but not
  1353.    certain, to be zero.)  If the proxy's request was a final HEAD-based
  1354.    report, it need no longer maintain the CU and CR values, but it may
  1355.    also set them to the number of intervening uses and reuses and retain
  1356.    them.
  1357.  
  1358. 5.3.2 Counting rules for usage-limiting
  1359.  
  1360.    A proxy participating in usage-limiting for a response R maintains
  1361.    either or both of two counters TU and TR, as appropriate, for that
  1362.    resource.  TU and TR are incremented in just the same way as CU and
  1363.    CR, respectively.  However, TU is zeroed only upon receipt of a
  1364.    "max-uses" Meter directive for that response (including the initial
  1365.    receipt).  Similarly, TR is zeroed only upon receipt of a "max-
  1366.    reuses" Meter directive for that response.
  1367.  
  1368.    A proxy participating in usage-limiting for a response R also stores
  1369.    values MU and/or MR associated with R. When it receives a response
  1370.    including only a max-uses value, it sets MU to that value and MR to
  1371.    infinity.  When it receives a response including only a max-reuses
  1372.    value, it sets MR to that value and MU to infinity.  When it receives
  1373.    a response including both max-reuses and max-reuses values, it sets
  1374.    MU and MR to those values, respectively.  When it receives a
  1375.    subsequent response including neither max-reuses nor max-reuses
  1376.    values, it sets both MU and MR to infinity.
  1377.  
  1378.    If a proxy participating in usage-limiting for a response R receives
  1379.    a request that would cause a "use" of R, and TU >= MU, it MUST
  1380.    forward the request to the server.  If it receives a request that
  1381.    would cause a "reuse" of R, and TR >= MR, it MUST forward the request
  1382.    to the server.  If (in either case) the proxy has already forwarded a
  1383.    previous request to the server and is waiting for the response, it
  1384.    should delay further handling of the new request until the response
  1385.    arrives (or times out); it SHOULD NOT have two revalidation requests
  1386.    pending at once that select the same response, unless these are Range
  1387.    requests selecting different subranges.
  1388.  
  1389.    There is a special case of this rule for the "max-uses" directive: if
  1390.    the proxy receives a response with "max-uses=0" and does not forward
  1391.    it to a requesting client, the proxy should set a flag PF associated
  1392.    with R. If R is true, then when a request arrives while if TU >= MU,
  1393.    if the PF flag is set, then the request need not be forwarded to the
  1394.    server (provided that this is not required by other caching rules).
  1395.    However, the PF flag MUST be cleared on any use of the response.
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402. Mogul & Leach               Standards Track                    [Page 25]
  1403.  
  1404. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1405.  
  1406.  
  1407.       Note: the "PF" flag is so named because this feature is useful
  1408.       only for caches that could issue a "prefetch" request before an
  1409.       actual client request for the response.  A proxy not implementing
  1410.       prefetching need not implement the PF flag.
  1411.  
  1412. 5.3.3 Equivalent algorithms are allowed
  1413.  
  1414.    Any other algorithm that exhibits the same external behavior (i.e.,
  1415.    generates exactly the same requests from the proxy to the server) as
  1416.    the one in this section is explicitly allowed.
  1417.  
  1418.       Note: in most cases, TU will be equal to CU, and TR will be
  1419.       equal to CR.  The only two cases where they could differ are:
  1420.  
  1421.          1. The proxy issues a non-conditional request for the
  1422.             resource using V, while TU and/or TR are non-zero, and
  1423.             the server's response includes a new "max-uses" and/or
  1424.             "max-reuses" directive (thus zeroing TU and/or TR, but
  1425.             not CU and CR).
  1426.  
  1427.          2. The proxy issues a conditional request reporting the
  1428.             hit-counts (and thus zeroing CU and CR, but not TU or
  1429.             TR), but the server's response does not include a new
  1430.             "max-uses" and/or "max-reuses" directive.
  1431.  
  1432.       To solve the first case, the proxy has several implementation
  1433.       options
  1434.  
  1435.          - Always store TU and TR separately from CU and CR.
  1436.  
  1437.          - Create "shadow" copies of TU and TR when this situation
  1438.            arises (analogous to "copy on write").
  1439.  
  1440.          - Generate a HEAD-based usage report when the
  1441.            non-conditional request is sent (or when the
  1442.            "max-uses=0" is received), causing CU and CR to be
  1443.            zeroed (analogous in some ways to a "memory barrier"
  1444.            instruction).
  1445.  
  1446.       In the second case, the server implicitly has removed the
  1447.       usage-limit(s) on the response (by setting MU and/or MR to
  1448.       infinity), and so the fact that, say, TU is different from CU
  1449.       is not significant.
  1450.  
  1451.       Note: It may also be possible to eliminate the PF flag by
  1452.       sending extra HEAD-based usage-report requests, but we
  1453.       recommend against this; it is better to allocate an extra bit
  1454.       per entry than to transmit extra requests.
  1455.  
  1456.  
  1457.  
  1458. Mogul & Leach               Standards Track                    [Page 26]
  1459.  
  1460. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1461.  
  1462.  
  1463. 5.4 Counting rules: interaction with Range requests
  1464.  
  1465.  
  1466.    HTTP/1.1 allows a client to request sub-ranges of a resource.  A
  1467.    client might end up issuing several requests with the net effect of
  1468.    receiving one copy of the resource.  For uniformity of the results
  1469.    seen by origin servers, proxies need to observe a rule for counting
  1470.    these references, although it is not clear that one rule generates
  1471.    accurate results in every case.
  1472.  
  1473.    The rule established in this specification is that proxies count as a
  1474.    "use" or "reuse" only those Range requests that result in the return
  1475.    of byte #0 of the resource.  The rationale for this rule is that in
  1476.    almost every case, an end-client will retrieve the beginning of any
  1477.    resource that it references at all, and that it will seldom retrieve
  1478.    any portion more than once.  Therefore, this rule appears to meet the
  1479.    goal of a "best-efforts" approximation.
  1480.  
  1481. 5.5 Implementation by non-caching proxies
  1482.  
  1483.    A non-caching proxy may participate in the metering subtree; this is
  1484.    strongly recommended.
  1485.  
  1486.    A non-caching proxy (HTTP/1.1 or higher) that participates in the
  1487.    metering subtree SHOULD forward Meter headers on both requests and
  1488.    responses, with the appropriate Connection headers.
  1489.  
  1490.    If a non-caching proxy forwards Meter headers, it MUST comply with
  1491.    these restrictions:
  1492.  
  1493.       1. If the proxy forwards Meter headers in responses, such a
  1494.          response MUST NOT be returned to any request except the
  1495.          one that elicited it.
  1496.  
  1497.       2. Once a non-caching proxy starts forwarding Meter headers,
  1498.          it should not arbitrarily stop forwarding them (or else
  1499.          reports may be lost).
  1500.  
  1501.    A proxy that caches some responses and not others, for whatever
  1502.    reason, may choose to implement the Meter header as a caching proxy
  1503.    for the responses that it caches, and as a non-caching proxy for the
  1504.    responses that it does not cache, as long as its external behavior
  1505.    with respect to any particularly response is fully consistent with
  1506.    this specification.
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514. Mogul & Leach               Standards Track                    [Page 27]
  1515.  
  1516. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1517.  
  1518.  
  1519. 5.6 Implementation by cooperating caches
  1520.  
  1521.    Several HTTP cache implementations, most notably the Harvest/Squid
  1522.    cache [2], create cooperative arrangements between several caches.
  1523.    If such caches use a protocol other than HTTP to communicate between
  1524.    themselves, such as the Internet Cache Protocol (ICP) [12], and if
  1525.    they implement the Meter header, then they MUST act to ensure that
  1526.    their cooperation does not violate the intention of this
  1527.    specification.
  1528.  
  1529.    In particular, if one member of a group of cooperating caches agrees
  1530.    with a server to hit-meter a particular response, and then passes
  1531.    this response via a non-HTTP protocol to a second cache in the group,
  1532.    the caches MUST ensure that the server which requested the metering
  1533.    receives reports that appropriately account for any uses or resues
  1534.    made by the second cache.  Similarly, if the first cache agreed to
  1535.    usage-limit the response, the total number of uses by the group of
  1536.    caches MUST be limited to the agreed-upon number.
  1537.  
  1538. 6 Examples
  1539.  
  1540. 6.1 Example of a complete set of exchanges
  1541.  
  1542.    This example shows how the protocol is intended to be used most of
  1543.    the time: for hit-metering without usage-limiting.  Entity bodies are
  1544.    omitted.
  1545.  
  1546.    A client sends request to a proxy:
  1547.  
  1548.        GET http://foo.com/bar.html HTTP/1.1
  1549.  
  1550.    The proxy forwards request to the origin server:
  1551.  
  1552.        GET /bar.html HTTP/1.1
  1553.        Host: foo.com
  1554.        Connection: Meter
  1555.  
  1556.    thus offering (implicitly) "will-report-and-limit".
  1557.  
  1558.    The server responds to the proxy:
  1559.  
  1560.        HTTP/1.1 200 OK
  1561.        Date: Fri, 06 Dec 1996 18:44:29 GMT
  1562.        Cache-control: max-age=3600
  1563.        Connection: meter
  1564.        Etag: "abcde"
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570. Mogul & Leach               Standards Track                    [Page 28]
  1571.  
  1572. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1573.  
  1574.  
  1575.    thus (implicitly) requiring "do-report" (but not requiring
  1576.    usage-limiting).
  1577.  
  1578.    The proxy responds to the client:
  1579.  
  1580.        HTTP/1.1 200 OK
  1581.        Date: Fri, 06 Dec 1996 18:44:29 GMT
  1582.        Etag: "abcde"
  1583.        Cache-control: max-age=3600, proxy-mustcheck
  1584.        Age: 1
  1585.  
  1586.    Since the proxy does not know if its client is an end-system, or a
  1587.    proxy that doesn't do metering, it adds the "proxy-mustcheck"
  1588.    directive.
  1589.  
  1590.    Another client soon asks for the resource:
  1591.  
  1592.        GET http://foo.com/bar.html HTTP/1.1
  1593.  
  1594.    and the proxy sends the same response as it sent to the other client,
  1595.    except (perhaps) for the Age value.
  1596.  
  1597.    After an hour has passed, a third client asks for the response:
  1598.  
  1599.        GET http://foo.com/bar.html HTTP/1.1
  1600.  
  1601.    But now the response's max-age has been exceeded, so the proxy
  1602.    revalidates the response with the origin server:
  1603.  
  1604.        GET /bar.html HTTP/1.1
  1605.        If-None-Match: "abcde"
  1606.        Host: foo.com
  1607.        Connection: Meter
  1608.        Meter: count=1/0
  1609.  
  1610.    thus simultaneously fulfilling its duties to validate the response
  1611.    and to report the one "use" that wasn't forwarded.
  1612.  
  1613.    The origin server responds:
  1614.  
  1615.        HTTP/1.1 304 Not Modified
  1616.        Date: Fri, 06 Dec 1996 19:44:29 GMT
  1617.        Cache-control: max-age=3600
  1618.        Etag: "abcde"
  1619.  
  1620.    so the proxy can use the original response to reply to the new
  1621.    client; the proxy also zeros the use-count it associates with that
  1622.    response.
  1623.  
  1624.  
  1625.  
  1626. Mogul & Leach               Standards Track                    [Page 29]
  1627.  
  1628. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1629.  
  1630.  
  1631.    Another client soon asks for the resource:
  1632.  
  1633.        GET http://foo.com/bar.html HTTP/1.1
  1634.  
  1635.    and the proxy sends the appropriate response.
  1636.  
  1637.    After another few hours, the proxy decides to remove the cache entry.
  1638.    When it does so, it sends to the origin server:
  1639.  
  1640.        HEAD /bar.html HTTP/1.1
  1641.        If-None-Match: "abcde"
  1642.        Host: foo.com
  1643.        Connection: Meter
  1644.        Meter: count=1/0
  1645.  
  1646.    reporting that one more use of the response was satisfied from the
  1647.    cache.
  1648.  
  1649. 6.2 Protecting against HTTP/1.0 proxies
  1650.  
  1651.    An origin server that does not want HTTP/1.0 caches to store the
  1652.    response at all, and is willing to have HTTP/1.0 end-system clients
  1653.    generate excess GETs (which will be forwarded by HTTP/1.0 proxies)
  1654.    could send this for its reply:
  1655.  
  1656.        HTTP/1.1 200 OK
  1657.        Cache-control: max-age=3600
  1658.        Connection: meter
  1659.        Etag: "abcde"
  1660.        Expires: Sun, 06 Nov 1994 08:49:37 GMT
  1661.  
  1662.    HTTP/1.0 caches will see the ancient Expires header, but HTTP/1.1
  1663.    caches will see the max-age directive and will ignore Expires.
  1664.  
  1665.       Note: although most major HTTP/1.0 proxy implementations observe
  1666.       the Expires header, it is possible that some are in use that do
  1667.       not.  Use of the Expires header to prevent caching by HTTP/1.0
  1668.       proxies might not be entirely reliable.
  1669.  
  1670. 6.3 More elaborate examples
  1671.  
  1672.    Here is a request from a proxy that is willing to hit-meter but is
  1673.    not willing to usage-limit:
  1674.  
  1675.        GET /bar.html HTTP/1.1
  1676.        Host: foo.com
  1677.        Connection: Meter
  1678.        Meter: wont-limit
  1679.  
  1680.  
  1681.  
  1682. Mogul & Leach               Standards Track                    [Page 30]
  1683.  
  1684. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1685.  
  1686.  
  1687.    Here is a response from an origin server that does not want hit
  1688.    counting, but does want "uses" limited to 3, and "reuses" limited to
  1689.    6:
  1690.  
  1691.        HTTP/1.1 200 OK
  1692.        Cache-control: max-age=3600
  1693.        Connection: meter
  1694.        Etag: "abcde"
  1695.        Expires: Sun, 06 Nov 1994 08:49:37 GMT
  1696.        Meter: max-uses=3, max-reuses=6, dont-report
  1697.  
  1698.    Here is the same example with abbreviated Meter directive names:
  1699.  
  1700.        HTTP/1.1 200 OK
  1701.        Cache-control: max-age=3600
  1702.        Connection: meter
  1703.        Etag: "abcde"
  1704.        Expires: Sun, 06 Nov 1994 08:49:37 GMT
  1705.        Meter:u=3,r=6,e
  1706.  
  1707. 7 Interactions with content negotiation
  1708.  
  1709.    This section describes two aspects of the interaction between hit-
  1710.    metering and "content-negotiated" resources:
  1711.  
  1712.       1. treatment of responses carrying a Vary header (section
  1713.          7.1).
  1714.  
  1715.       2. treatment of responses that use the proposed Transparent
  1716.          Content Negotiation mechanism (section 7.2).
  1717.  
  1718. 7.1 Treatment of responses carrying a Vary header
  1719.  
  1720.    Separate counts should be kept for each combination of the headers
  1721.    named in the Vary header for the Request-URI (what [4] calls "the
  1722.    selecting request-headers"), even if they map to the same entity-tag.
  1723.    This rule has the effect of counting hits on each variant, if there
  1724.    are multiple variants of a page available.
  1725.  
  1726.       Note: This interaction between Vary and the hit-counting
  1727.       directives allows the origin server a lot of flexibility in
  1728.       specifying how hits should be counted.  In essence, the origin
  1729.       server uses the Vary mechanism to divide the requests for a
  1730.       resource into arbitrary categories, based on the request- headers.
  1731.       (We will call these categories "request-patterns".) Since a proxy
  1732.       keeps its hit-counts for each request-pattern, rather than for
  1733.       each resource, the origin server can obtain separate statistics
  1734.       for many aspects of an HTTP request.
  1735.  
  1736.  
  1737.  
  1738. Mogul & Leach               Standards Track                    [Page 31]
  1739.  
  1740. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1741.  
  1742.  
  1743.    For example, if a page varied based on the value of the User-Agent
  1744.    header in the requests, then hit counts would be kept for each
  1745.    different flavor of browser. But it is in fact more general than
  1746.    that; because multiple header combinations can map to the same
  1747.    variant, it also enables the origin server to count the number of
  1748.    times (e.g.) the Swahili version of a page was requested, even though
  1749.    it is only available in English.
  1750.  
  1751.    If a proxy does not support the Vary mechanism, then [4] says that it
  1752.    MUST NOT cache any response that carries a Vary header, and hence
  1753.    need not implement any aspect of this hit-counting or usage-limiting
  1754.    design for varying resources.
  1755.  
  1756.        Note: this also implies that if a proxy supports the Vary
  1757.        mechanism but is not willing to maintain independent hit-counts
  1758.        for each variant response in its cache, then it must follow at
  1759.        least one of these rules:
  1760.  
  1761.           1. It must not use the Meter header in a request to offer
  1762.              to hit-meter or usage-limit responses.
  1763.  
  1764.           2. If it does offer to hit-meter or usage-limit responses,
  1765.              and then receives a response that includes both a Vary
  1766.              header and a Meter header with a directive that it
  1767.              cannot satisfy, then the proxy must not cache the
  1768.              response.
  1769.  
  1770.        In other words, a proxy is allowed to partially implement the
  1771.        Vary mechanism with respect to hit-metering, as long as this has
  1772.        no externally visible effect on its ability to comply with the
  1773.        Meter specification.
  1774.  
  1775.    This approach works for counting almost any aspect of the request
  1776.    stream, without embedding any specific list of countable aspects in
  1777.    the specification or proxy implementation.
  1778.  
  1779. 7.2 Interaction with Transparent Content Negotiation
  1780.  
  1781.    [A description of the interaction between this design and the
  1782.    proposed Transparent Content Negotiation (TCN) design [6] will be
  1783.    made available in a later document.]
  1784.  
  1785. 8 A Note on Capturing Referrals
  1786.  
  1787.    It is alleged that some advertisers want to pay content providers,
  1788.    not by the "hit", but by the "nibble" -- the number of people who
  1789.    actually click on the ad to get more information.
  1790.  
  1791.  
  1792.  
  1793.  
  1794. Mogul & Leach               Standards Track                    [Page 32]
  1795.  
  1796. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1797.  
  1798.  
  1799.    Now, HTTP already has a mechanism for doing this: the "Referer"
  1800.    header. However, perhaps it ought to be disabled for privacy reasons
  1801.    -- according the HTTP/1.1 spec:
  1802.  
  1803.        "Because the source of the link may be private information or may
  1804.        reveal an otherwise private information source, it is strongly
  1805.        recommended that the user be able to select whether or not the
  1806.        Referer field is sent."
  1807.  
  1808.    However, in the case of ads, the source of the link actually wants to
  1809.    let the referred-to page know where the reference came from.
  1810.  
  1811.    This does not require the addition of any extra mechanism, but rather
  1812.    can use schemes that embed the referrer in the URI in a manner
  1813.    similar to this:
  1814.  
  1815.           http://www.blah.com/ad-reference?from=site1
  1816.  
  1817.    Such a URI should point to a resource (perhaps a CGI script) which
  1818.    returns a 302 redirect to the real page
  1819.  
  1820.           http://www.blah.com/ad-reference.html
  1821.  
  1822.    Proxies which do not cache 302s will cause one hit on the redirection
  1823.    page per use, but the real page will get cached. Proxies which do
  1824.    cache 302s and report hits on the cached 302s will behave optimally.
  1825.  
  1826.    This approach has the advantage that it works whether or not the
  1827.    end-client has disabled the use of Referer.  Combined with the rest
  1828.    of the hit-metering proposal in this design, this approach allows,
  1829.    for example, an advertiser to know how often a reference to an
  1830.    advertisement was made from a particular page.
  1831.  
  1832. 9 Alternative proposals
  1833.  
  1834.    There might be a number of other ways of gathering demographic and
  1835.    usage information; other mechanisms might respond to a different set
  1836.    of needs than this proposal does.  This proposal certainly does not
  1837.    preclude the proposal or deployment of other such mechanisms, and
  1838.    many of them may be complementary to and compatible with the
  1839.    mechanism proposed here.
  1840.  
  1841.    There has been some speculation that statistical sampling methods
  1842.    might be used to gather reasonably accurate data.  One such proposal
  1843.    is to manipulate cache expiration times so that selected resources
  1844.    are uncachable for carefully chosen periods, allowing servers to
  1845.    accurately count accesses during those periods.  The hit-metering
  1846.    mechanism proposed here is entirely complementary to that approach,
  1847.  
  1848.  
  1849.  
  1850. Mogul & Leach               Standards Track                    [Page 33]
  1851.  
  1852. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1853.  
  1854.  
  1855.    since it could be used to reduce the cost of gathering those counts.
  1856.    James Pitkow has written a paper comparing an earlier draft of this
  1857.    hit-metering proposal with sampling approaches [9].
  1858.  
  1859.    Phillip Hallam-Baker has proposed using a log-exchange protocol [5],
  1860.    by which a server could request a proxy's logs by making an HTTP
  1861.    request to the proxy.  This proposal asserts that it is "believed to
  1862.    operate correctly in configurations involving multiple proxies", but
  1863.    it is not clear that this is true if an outer proxy is used as a
  1864.    (one-way) firewall.  The proposal also leaves a number of open
  1865.    issues, such as how an origin server can be sure that all of the
  1866.    proxies in the request subtree actually support log-exchange.  It is
  1867.    also not clear how this proposal couples a proxy's support of log-
  1868.    exchange to a server's permission to cache a response.
  1869.  
  1870.    For general background on the topic of Web measurement standards, see
  1871.    the discussion by Thomas P. Novak and Donna L. Hoffman [8].  Also see
  1872.    the "Privacy and Demographics Overview" page maintained by by the
  1873.    World Wide Web Consortium [10], which includes a pointer to some
  1874.    tentative proposals for gathering consumer demographics (not just
  1875.    counting references) [3].
  1876.  
  1877. 10 Security Considerations
  1878.  
  1879.    Which outbound clients should a server (proxy or origin) trust to
  1880.    report hit counts?  A malicious proxy could easily report a large
  1881.    number of hits on some page, and thus perhaps cause a large payment
  1882.    to a content provider from an advertiser.  To help avoid this
  1883.    possibility, a proxy may choose to only relay usage counts received
  1884.    from its outbound proxies to its inbound servers when the proxies
  1885.    have authenticated themselves using Proxy-Authorization and/or they
  1886.    are on a list of approved proxies.
  1887.  
  1888.    It is not possible to enforce usage limits if a proxy is willing to
  1889.    cheat (i.e., it offers to limit usage but then ignores a server's
  1890.    Meter directive).
  1891.  
  1892.    Regarding privacy:  it appears that the design in this document does
  1893.    not reveal any more information about individual users than would
  1894.    already be revealed by implementation of the existing HTTP/1.1
  1895.    support for "Cache-control: max-age=0, proxy-revalidate" or "Cache-
  1896.    control: s-maxage=0".  It may, in fact, help to conceal certain
  1897.    aspects of the organizational structure on the outbound side of a
  1898.    proxy.  In any case, the conflict between user requirements for
  1899.    anonymity and origin server requirements for demographic information
  1900.    cannot be resolved by purely technical means.
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906. Mogul & Leach               Standards Track                    [Page 34]
  1907.  
  1908. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1909.  
  1910.  
  1911. 11 Acknowledgments
  1912.  
  1913.    We gratefully acknowledge the constructive comments received from
  1914.    Anselm Baird-Smith, Ted Hardie, Koen Holtman (who suggested the
  1915.    technique described in section 8), Dave Kristol, Ari Luotonen,
  1916.    Patrick R. McManus, Ingrid Melve, and James Pitkow.
  1917.  
  1918. 12 References
  1919.  
  1920.    1.  Bradner, S.,  "Key words for use in RFCs to Indicate Requirement
  1921.        Levels", BCP 14, RFC 2119, March 1997.
  1922.  
  1923.    2.  Anwat Chankhunthod, Peter B. Danzig, Chuck Neerdaels, Michael
  1924.        F. Schwartz, and Kurt J. Worrell.  A Hierarchical Internet Object
  1925.        Cache.  Proc. 1996 USENIX Technical Conf., San Diego, January,
  1926.        1996, pp. 153-163.
  1927.  
  1928.    3.  Daniel W. Connolly.  Proposals for Gathering Consumer
  1929.        Demographics.
  1930.        http://www.w3.org/pub/WWW/Demographics/Proposals.html.
  1931.  
  1932.    4.  Fielding, R., Gettys, J., Mogul, J., Nielsen, H. and T.
  1933.        Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1," RFC 2068,
  1934.        January, 1997.
  1935.  
  1936.    5.  Phillip M. Hallam-Baker.  Notification for Proxy Caches.  W3C
  1937.        Working Draft WD-proxy-960221, World Wide Web Consortium,
  1938.        February, 1996. http://www.w3.org/pub/WWW/TR/WD-proxy.html.
  1939.  
  1940.    6.  Holtman, K., and A. Mutz, "Transparent Content Negotiation in
  1941.        HTTP", Work in Progress.
  1942.  
  1943.    7.  Mogul, J., "Forcing HTTP/1.1 proxies to revalidate responses",
  1944.        Work in Progress.
  1945.  
  1946.    8.  Thomas P. Novak and Donna L. Hoffman.  New Metrics for New Media:
  1947.        Toward the Development of Web Measurement Standards.  This is a
  1948.        draft paper, currently available at http://
  1949.        www2000.ogsm.vanderbilt.edu/novak/web.standards/webstand.html.
  1950.        Cited by permission of the author; do not quote or cite without
  1951.        permission.
  1952.  
  1953.    9.  James Pitkow.  In search of reliable usage data on the WWW.
  1954.        Proc. Sixth International World Wide Web Conference, Santa Clara,
  1955.        CA, April, 1997.
  1956.  
  1957.  
  1958.  
  1959.  
  1960.  
  1961.  
  1962. Mogul & Leach               Standards Track                    [Page 35]
  1963.  
  1964. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  1965.  
  1966.  
  1967.    10. Joseph Reagle, Rohit Khare, Dan Connolly, and Tim Berners-Lee.
  1968.        Privacy and Demographics Overview.
  1969.        http://www.w3.org/pub/WWW/Demographics/.
  1970.  
  1971.    11. Linda Tauscher and Saul Greenberg.  Revisitation Patterns in
  1972.        World Wide Web Navigation.  Research Report 96/587/07, Department
  1973.        of Computer Science, University of Calgary, March, 1996.
  1974.        http://www.cpsc.ucalgary.ca/projects/grouplab/
  1975.        papers/96WebReuse/TechReport96.html.
  1976.  
  1977.    12. Wessels, D., and K. Claffy "Internet Cache Protocol (ICP),
  1978.        version 2", RFC 2186, September 1997.
  1979.  
  1980. 13 Authors' Addresses
  1981.  
  1982.    Jeffrey C. Mogul
  1983.    Western Research Laboratory
  1984.    Digital Equipment Corporation
  1985.    250 University Avenue
  1986.    Palo Alto, California, 94305, U.S.A.
  1987.  
  1988.    EMail: mogul@wrl.dec.com
  1989.    Phone: 1 415 617 3304 (email preferred)
  1990.  
  1991.  
  1992.    Paul J. Leach
  1993.    Microsoft
  1994.    1 Microsoft Way
  1995.    Redmond, Washington, 98052, U.S.A.
  1996.  
  1997.    EMail: paulle@microsoft.com
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018. Mogul & Leach               Standards Track                    [Page 36]
  2019.  
  2020. RFC 2227            Hit-Metering and Usage-Limiting         October 1997
  2021.  
  2022.  
  2023. 14 Full Copyright Statement
  2024.  
  2025.    Copyright (C) The Internet Society (1997).  All Rights Reserved.
  2026.  
  2027.    This document and translations of it may be copied and furnished to
  2028.    others, and derivative works that comment on or otherwise explain it
  2029.    or assist in its implmentation may be prepared, copied, published
  2030.    andand distributed, in whole or in part, without restriction of any
  2031.    kind, provided that the above copyright notice and this paragraph are
  2032.    included on all such copies and derivative works.  However, this
  2033.    document itself may not be modified in any way, such as by removing
  2034.    the copyright notice or references to the Internet Society or other
  2035.    Internet organizations, except as needed for the purpose of
  2036.    developing Internet standards in which case the procedures for
  2037.    copyrights defined in the Internet Standards process must be
  2038.    followed, or as required to translate it into languages other than
  2039.    English.
  2040.  
  2041.    The limited permissions granted above are perpetual and will not be
  2042.    revoked by the Internet Society or its successors or assigns.
  2043.  
  2044.    This document and the information contained herein is provided on an
  2045.    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  2046.    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  2047.    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  2048.    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  2049.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074. Mogul & Leach               Standards Track                    [Page 37]
  2075.  
  2076.