<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.2.9 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>

<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>

<rfc ipr="trust200902" docName="draft-bishop-httpbis-push-cases-00" category="info">

  <front>
    <title abbrev="Push Use Cases">HTTP/2 Server Push Use Cases</title>

    <author initials="M." surname="Bishop" fullname="Mike Bishop">
      <organization>Akamai</organization>
      <address>
        <email>mbishop@evequefou.be</email>
      </address>
    </author>

    <date />

    <area>Applications</area>
    <workgroup>HTTPbis</workgroup>
    <keyword>Internet-Draft</keyword>

    <abstract>


<t>HTTP/2 defines the wire mechanics of Server Push. Though the mechanics of how a
pushed resource is delivered are well-specified, the use cases that describe
which resources can be pushed, in what states, and for what purpose are not
described in HTTP/2.  As a result, support between implementations varies
widely.</t>

<t>This document attempts to enumerate interesting scenarios, in hopes that a more
concrete taxonomy can assist the community in arriving at a standard set of
supported scenarios.</t>



    </abstract>


  </front>

  <middle>


<section anchor="problems" title="Introduction">

<t>HTTP is fundamentally a request/response mechanism.  Each request specifies some
action (often content retrieval) which the user agent wishes the server to
perform on a resource and return the result of the action.</t>

<t>However, when a response triggers a subsequent request, network and processing
delays cause this subsequent request not to begin immediately.  The client must
receive the initial response (0.5 RTT network delay), parse it and identify the
next request (implementation- and page-dependent), then send the request back to
the server (0.5 RTT network delay) before the server can begin to satisfy the
request.</t>

<t>Some mechanisms attempt to reduce the client processing time by enumerating
important follow-up requests in HTTP headers or at the beginning of the response
payload.  However, these techniques still incur at least 1 RTT of network delay
before the server receives the subsequent request.  Depending on the distance
between client and server, this delay might be significant.</t>

<t>HTTP/2 defines Server Push, a paradigm in which the server can also return the
results of actions the user agent did <spanx style="emph">not</spanx> request.  In order to preserve the
request-response semantics of HTTP, the server first “promises” something by
supplying the request to which it will later provide a response as if the user
agent had made the supplied request. Push is also restricted to methods which
are defined to be safe and cacheable.  (Though the response itself need not be
cacheable.)</t>

<t>A push is always associated directly with a client-generated request. No
chaining is permitted (a push cannot be associated with another push), nor can a
push be promised after the client-initiated stream has closed, though a promised
push can be fulfilled at any subsequent time.</t>

<t>This document is an attempt to enumerate categories of resources and situations
in which a server might choose to push a resource.</t>

</section>
<section anchor="types-of-resources" title="Types of Resources">

<section anchor="browser-scenarios" title="Browser Scenarios">

<t>The most visible use case for HTTP is the web browser.  Because a web page is
composed of a large number of resources, often spread across different domains,
browsers issue a complex series of requests in the course of rendering a page.
However, because browsers are generating these requests based on the combination
of server-supplied content (the initial response) and local state (the contents
of the cache, if any), the server is able to partially predict the client’s
rendering behavior.  Efforts to standardize the download process between clients
(<xref target="FETCH"></xref>) and to supply more information about the local state to the server
(<xref target="I-D.ietf-httpbis-cache-digest"></xref>) will improve the server’s ability to predict
such subsequent requests.</t>

<t>However, web pages are increasingly dynamic, and this makes the browser’s job of
determining what is logically connected with the initial request more complex.</t>

<section anchor="static-dom-contents" title="Static DOM contents">

<t>This is almost universally-supported among browsers.  If the resource directly
references another resource, either via Link headers (<xref target="RFC5988"></xref>) or via the
entity body, almost all browsers will accept a match for this resource served as
a push.</t>

<t>Such resources are typically CSS, JavaScript, images, or other elements required
for the rendering or functionality of the page.</t>

</section>
<section anchor="updated-dom-contents" title="Updated DOM contents">

<t>After the DOM is constructed, it can be locally modified.  Some web sites
consist of very sparse static content, then rely on the execution of scripts
locally to create DOM elements or update existing elements to reference new
target resources.</t>

</section>
<section anchor="browser-script" title="Requests made by local script execution">

<t>The locally executed script, rather than updating DOM elements, is also able to
directly generate new HTTP requests (typically so that they can populate DOM
elements by script).  Many sites have expressed use-cases for pre-answering
queries their script would generate in response to user action.</t>

<t>For example, the page might contain a list of e-mails, with script populating
the contents of the e-mail once the user clicks a list entry.  If a site author
knows the user is likely to click one of the first three unread e-mails, the
contents of those e-mails are reasonable candidates for Server Push.</t>

</section>
</section>
<section anchor="non-browser-scenarios" title="Non-Browser Scenarios">

<t>Non-browser scenarios can typically be analyzed as an API.</t>

<section anchor="subsequent-api-requests" title="Subsequent API Requests">

<t>There is substantial overlap between non-browser scenarios and the in-browser
script scenario described in <xref target="browser-script"/>.  In both cases, the server is
predicting subsequent API calls based on where it believes the client is in the
process of execution.</t>

<t>If the server can predict subsequent actions, it can pre-satisfy the most likely
cases in order to minimize latency.</t>

</section>
<section anchor="streaming-apis" title="Streaming APIs">

<t>Some APIs do not fit well with the request-response model of HTTP, but are
better understood as a subscription to an event or a data stream.  Push can be
used in this model, as in <xref target="RFC8030"></xref>, by opening a request which never completes
and pushing new data to the client as it becomes available.</t>

<t>Some implementations of push do not make incoming push streams available to
clients unless the client makes a request for the corresponding URL.  As a
result, clients and servers implementing this pattern might wish to also use the
original request to stream back the resource identifiers which are being pushed.</t>

</section>
</section>
</section>
<section anchor="types-of-pushes" title="Types of Pushes">

<t>In addition to pushing different resources, push can be delivered in different
ways and for different purposes.</t>

<section anchor="pre-satisfying-requests" title="Pre-Satisfying Requests">

<t>The most common and most widely supported variety of push simply provides a
request that the client is expected to make, along with a successful (typically
200) response carrying the content.</t>

</section>
<section anchor="cache-population" title="Cache Population">

<t>Pushing resources into the client cache has been a subject of some controversy.
Almost all browsers implement a separate and ephemeral cache of pushed resources
and do not allow pushed resources to write directly into the HTTP cache,
theoretically as a mitigation against populating the cache with content that
will never actually be needed.</t>

<t>However, mechanisms such as Link headers (<xref target="RFC5988"></xref>) with the <spanx style="verb">rel=preload</spanx>
attribute can cause the browser to request any resource, and these headers are
also under the server’s control.  As a result, any client that implements
<xref target="pre-satisfying-requests"/> will also enable cache population with one
additional step.</t>

</section>
<section anchor="cache-revalidation" title="Cache Revalidation">

<t>While no user agents are known to support this, a server could hypothetically
pre-validate stale items in the client’s cache by pushing a conditional request
(If-Not-Match or If-Not-Modified) for a resource it believes is already in the
cache and a 304 (Not Modified) response.</t>

<t>Such a push could be consumed directly by the cache (updating the validity of
the cached object) or treated as a pre-satisfied request should the cache
attempt to revalidate an expired object.  The former will tend to extend the
lifetime of the cached object on each use, while the latter will not affect the
object unless it has expired.</t>

<t>A push which attempts to revalidate content which is no longer cached could be
treated equivalently to a preload link, a suggestion that this content might
soon be needed. Triggering a follow-up request for the full body might improve
performance.</t>

</section>
<section anchor="cache-invalidation" title="Cache Invalidation">

<t>Alternatively, the server could push an unconditional request for the resource,
but use the HEAD method instead of GET.  If interpreted appropriately by a user
agent, this could revalidate a matching item in the cache, or invalidate an item
even if the user agent currently believes the item to be fresh.</t>

</section>
</section>
<section anchor="security-considerations" title="Security Considerations">

<t>There probably are some. The existing mitigations against gratuitous pushes are
largely ineffective (see <xref target="cache-population"/>), but clients MUST verify that
servers are authoritative for any resources they attempt to push, regardless of
the scenario being considered.</t>

</section>


  </middle>

  <back>


    <references title='Informative References'>





<reference  anchor="RFC7540" target='https://www.rfc-editor.org/info/rfc7540'>
<front>
<title>Hypertext Transfer Protocol Version 2 (HTTP/2)</title>
<author initials='M.' surname='Belshe' fullname='M. Belshe'><organization /></author>
<author initials='R.' surname='Peon' fullname='R. Peon'><organization /></author>
<author initials='M.' surname='Thomson' fullname='M. Thomson' role='editor'><organization /></author>
<date year='2015' month='May' />
<abstract><t>This specification describes an optimized expression of the semantics of the Hypertext Transfer Protocol (HTTP), referred to as HTTP version 2 (HTTP/2).  HTTP/2 enables a more efficient use of network resources and a reduced perception of latency by introducing header field compression and allowing multiple concurrent exchanges on the same connection.  It also introduces unsolicited push of representations from servers to clients.</t><t>This specification is an alternative to, but does not obsolete, the HTTP/1.1 message syntax.  HTTP's existing semantics remain unchanged.</t></abstract>
</front>
<seriesInfo name='RFC' value='7540'/>
<seriesInfo name='DOI' value='10.17487/RFC7540'/>
</reference>



<reference  anchor="RFC5988" target='https://www.rfc-editor.org/info/rfc5988'>
<front>
<title>Web Linking</title>
<author initials='M.' surname='Nottingham' fullname='M. Nottingham'><organization /></author>
<date year='2010' month='October' />
<abstract><t>This document specifies relation types for Web links, and defines a registry for them.  It also defines the use of such links in HTTP headers with the Link header field.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='5988'/>
<seriesInfo name='DOI' value='10.17487/RFC5988'/>
</reference>



<reference  anchor="RFC8030" target='https://www.rfc-editor.org/info/rfc8030'>
<front>
<title>Generic Event Delivery Using HTTP Push</title>
<author initials='M.' surname='Thomson' fullname='M. Thomson'><organization /></author>
<author initials='E.' surname='Damaggio' fullname='E. Damaggio'><organization /></author>
<author initials='B.' surname='Raymor' fullname='B. Raymor' role='editor'><organization /></author>
<date year='2016' month='December' />
<abstract><t>This document describes a simple protocol for the delivery of real- time events to user agents.  This scheme uses HTTP/2 server push.</t></abstract>
</front>
<seriesInfo name='RFC' value='8030'/>
<seriesInfo name='DOI' value='10.17487/RFC8030'/>
</reference>



<reference anchor="I-D.ietf-httpbis-cache-digest">
<front>
<title>Cache Digests for HTTP/2</title>

<author initials='K' surname='Oku' fullname='Kazuho Oku'>
    <organization />
</author>

<author initials='M' surname='Nottingham' fullname='Mark Nottingham'>
    <organization />
</author>

<date month='May' day='29' year='2017' />

<abstract><t>This specification defines a HTTP/2 frame type to allow clients to inform the server of their cache's contents.  Servers can then use this to inform their choices of what to push to clients.  Note to Readers  Discussion of this draft takes place on the HTTP working group mailing list (ietf-http-wg@w3.org), which is archived at https://lists.w3.org/Archives/Public/ietf-http-wg/ .  Working Group information can be found at http://httpwg.github.io/ ; source code and issues list for this draft can be found at https://github.com/httpwg/http-extensions/labels/cache-digest .</t></abstract>

</front>

<seriesInfo name='Internet-Draft' value='draft-ietf-httpbis-cache-digest-02' />
<format type='TXT'
        target='http://www.ietf.org/internet-drafts/draft-ietf-httpbis-cache-digest-02.txt' />
</reference>


<reference anchor="FETCH" target="https://fetch.spec.whatwg.org">
  <front>
    <title>Fetch Living Standard</title>
    <author >
      <organization></organization>
    </author>
    <date year="n.d."/>
  </front>
</reference>


    </references>



  </back>

<!-- ##markdown-source:
H4sIAEe4NlsAA31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