Subresources-If-None-Match = "Subresources-If-None-Match" ":" ( "*" | 1#entity-tag )
(1) its entity tag is included in the list of entity tags; or
(a) "*" is given; and
(b) any current entity exists for that resource
Subresources-If-Modified-Since = "Subresources-If-Modified-Since" ":" HTTP-date
(1) the given date is valid; and
(a) the entity has not been modified since the given date; or
(b) the entity was not related to the requested resource at the given date; or
(i) it is not known whether the entity was related to the requested resource at the given date; and
(ii) the requested resource has not been modified since the given date
Subresource-Of = "Subresource-Of" ":" 1#relativeURI
Indicates the both the server and any intermediate caches MUST NOT push any streams in response to this request.
Indicates that any intermediate caches MUST NOT push any streams in response to this request.
Indicates that both the server and any intermediate caches MUST NOT push any streams in response to this request if the request is successfully revalidated (i.e. a 304 Not Modified response is sent).
Indicates that both the server and any intermediate caches MUST NOT push any stream in response to this request if the pushed resource is successfully revalidated (i.e. a 304 Not Modified would be sent).
Identical to their variants without "push-", but only apply to pushed streams.
(1) If the related resource is in cache and meets the cache-control restrictions, the proxy MAY push the resource's cached entry.
(2) If the related resource is not in cache, would meet the cache-control restrictions, and the proxy decides that the server does not normally push the resource (either through tracking previous requests or because the proxy is an HTTP gateway), the proxy MAY make a separate request to the server for the resource (with a no-push cache control directive), and forward the response downstream as a pushed stream. The proxy MAY follow 3xx redirects.
Hi all,Some others (https://groups.google.com/d/topic/spdy-dev/xe37J7EgcoE/discussion, https://groups.google.com/d/topic/spdy-dev/KpDGLQYCsk0/discussion, https://groups.google.com/d/topic/spdy-dev/Lu8XpKhl2h8/discussion), have discussed the need for fine-grained cache control for SPDY pushed streams. The client currently has no way to communicate to the server which subresources it has cached, independently of its cache-validation headers for the actual request. This problem is compounded by the fact that subresources (Javascript, CSS, etc) are often shared between multiple resources on a web site, all of which, in turn, may try to push content the client already has. In addition, some user agents (like wget or web crawlers) may be uninterested in having content pushed to them, and doing so would be a waste of bandwidth.As a first step toward addressing these issues, I've drafted some additions to the HTTP/1.1 caching mechanisms (http://www.w3.org/Protocols/rfc2616/rfc2616.html 14.9, 14.24-14.28), which are given in rough form below. I'm not sure where these would fit into either the HTTP or SPDY specs, but they're formatted mostly in the style of RFC 2616. There is also some language in the last section that covers rules for proxy behavior. I'd love any feedback, especially additions, deletions, criticisms, or questions - I'm particularly unsure about the naming.Thanks,Alek Storm
Cache-Validating Headers
-------------------------------------Subresources-If-None-MatchSubresources-If-None-Match = "Subresources-If-None-Match" ":" ( "*" | 1#entity-tag )For each entity that would have been pushed in response to a similar GET request (without the Subresources-If-None-Match) on that resource, if:(1) its entity tag is included in the list of entity tags; or(a) "*" is given; and(b) any current entity exists for that resourcethen the server MUST NOT push that entity, unless required to do so because the entity's modification date fails to match that supplied in an Subresources-If-Modified-Since header field in the request. Instead, if the request method was GET or HEAD, the server SHOULD push a 304 (Not Modified) response, including the cache-related header fields (particularly ETag) of one of the entities that matched.
Comments: Clients should include entity tags for resources which included the requested URI in their Subresource-Of header when they were last fetched, or all entity tags from the requested domain for Content-Types likely to be pushed (application/javascript, text/css).
However, if I understand it right, this basically introduces a new index for HTTP client caches - the "subresource-of". It's a lot of management. In order to issue any request, the cache now needs to lookup the exhaustive list of potential subresources, find their tags, and send them up in a big list. This is a large, non-trivial amount of work, and it may not be too fast either ;-) Is there a limit to how many subresources a resource can have? Given that we've got pages with hundreds of subresources, do all of them become subresources in this scheme?
If they did, wouldn't that mean that sending a request would require N client-side cache lookups (or a database to index etags by subresources)?
Can a single resource be a subresource of multiple other resources (e.g. a common style sheet across multiple resources)?
Overall, I think this works, and we did consider such schemes early on. However, the practical concerns about client-side cache management made us reject it before really trying.
PS - the server management of the resource/subresource relationship is also tricky, but probably automatable.
Hi Mike,On Wed, May 30, 2012 at 10:19 AM, Mike Belshe <mbe...@chromium.org> wrote:
However, if I understand it right, this basically introduces a new index for HTTP client caches - the "subresource-of". It's a lot of management. In order to issue any request, the cache now needs to lookup the exhaustive list of potential subresources, find their tags, and send them up in a big list. This is a large, non-trivial amount of work, and it may not be too fast either ;-) Is there a limit to how many subresources a resource can have? Given that we've got pages with hundreds of subresources, do all of them become subresources in this scheme?That depends on what you mean by "subresource". Since you mention "hundreds" of them, I assume you mean any resource referenced by a page; I meant only resources pushed by the server (certainly most of the resources needed by a page can wait to be loaded until after the HTML referencing them arrives). The beauty of HTTP cache management is that much of its implementation is left to browsers - there is nothing forcing the client to send a long Subresources-If-None-Match header if it feels that performance would be impacted negatively; it could send only the first ten etags it finds, or none at all. The browser cache could be cleared at any time by the user anyway, so it would be useless to mandate which headers "must" be sent.If they did, wouldn't that mean that sending a request would require N client-side cache lookups (or a database to index etags by subresources)?I think you're not giving browser developers enough credit :). To my understanding, caches are already implemented as lightweight databases already; I don't see how each cache entry storing a list of its subresources would be a non-negligible performance burden. Even if it were, don't the bandwidth savings of not having to retransmit a resource outweight the costs of looking up its etag in memory?
Can a single resource be a subresource of multiple other resources (e.g. a common style sheet across multiple resources)?Yes, and the Subresource-Of header specifically provides servers/proxies with a way to notify the client of these relationships, so that Subresource-If-* headers can be sent on subsequent requests to new, un-cached resources whose subresources would otherwise be unknown.
Overall, I think this works, and we did consider such schemes early on. However, the practical concerns about client-side cache management made us reject it before really trying.In the time since posting this, I've discovered the HTTPbis working group, which would be a more appropriate place to submit this proposal for consideration in a day or two. Are you on that mailing list as well?
On Thu, May 31, 2012 at 9:18 PM, Alek Storm <alek....@gmail.com> wrote:On Wed, May 30, 2012 at 10:19 AM, Mike Belshe <mbe...@chromium.org> wrote:Can a single resource be a subresource of multiple other resources (e.g. a common style sheet across multiple resources)?Yes, and the Subresource-Of header specifically provides servers/proxies with a way to notify the client of these relationships, so that Subresource-If-* headers can be sent on subsequent requests to new, un-cached resources whose subresources would otherwise be unknown.I don't know quite how this works; if we want to push the subresource for the first page access, and then not push it again subsequently, the subresource would have to be marked as 'subresource-of' for all the subsequent pages too to avoid being re-pushed? I suppose other logic could be employed to handle this, but it seems like it misses the most common push case?
What client are you testing? Chrome? If so, yes it's known that (1) and (2) are not implemented yet. The push support is very naive. Patches welcome.
--
---
You received this message because you are subscribed to the Google Groups "spdy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spdy-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.