A SPDY push strategy that auto-populates push metadata based on referrer URLs.
A typical request for a main
resource such as
index.html is immediately followed by a number of requests for associated resources.
Associated resource requests will have a
Referer HTTP header that points to
index.html, which is used
to link the associated resource to the main resource.
However, also following a hyperlink generates a HTTP request
with a
Referer HTTP header that points to
index.html; therefore a proper value for
#setReferrerPushPeriod(int) has to be set. If the referrerPushPeriod for a main resource has elapsed, no more
associated resources will be added for that main resource.
This class distinguishes associated main resources by
their URL path suffix and content type. CSS stylesheets, images and JavaScript files have recognizable URL path
suffixes that are classified as associated resources. The suffix regexs can be configured by constructor argument
When CSS stylesheets refer to images, the CSS image request will have the CSS stylesheet as referrer. This
implementation will push also the CSS image.
The push metadata built by this implementation is limited by the
number of pages of the application itself, and by the
#setMaxAssociatedResources(int) max associated
resources} parameter. This parameter limits the number of associated resources per each main resource, so that if a
main resource has hundreds of associated resources, only up to the number specified by this parameter will be
pushed.