Page Speed Optimization Libraries
1.9.32.2
|
#include "instaweb_handler.h"
Public Member Functions | |
InstawebHandler (request_rec *request) | |
const GoogleUrl & | stripped_gurl () const |
Any PageSpeed query params are removed. | |
const RequestContextPtr | request_context () const |
bool | use_custom_options () const |
const QueryParams & | query_params () |
const QueryParams & | pagespeed_query_params () |
const QueryParams & | pagespeed_option_cookies () |
void | SetupSpdyConnectionIfNeeded () |
void | RemoveStrippedResponseHeadersFromApacheRequest () |
RewriteDriver * | MakeDriver () |
ApacheFetch * | MakeFetch (const GoogleString &url) |
ApacheFetch * | MakeFetch () |
bool | HandleAsProxy () |
bool | HandleAsInPlace () |
void | HandleAsPagespeedResource () |
void | WaitForFetch () |
Waits for an outstanding fetch (obtained by MakeFetch) to complete. | |
bool | ProxyUrl () |
RequestHeaders * | ReleaseRequestHeaders () |
const SystemRewriteOptions * | options () |
Static Public Member Functions | |
static bool | is_pagespeed_subrequest (request_rec *request) |
static apr_status_t | instaweb_handler (request_rec *request) |
static apr_status_t | save_url_hook (request_rec *request) |
static apr_status_t | save_url_in_note (request_rec *request, ApacheServerContext *server_context) |
static apr_status_t | instaweb_map_to_storage (request_rec *request) |
static void | AboutToBeDoneWithRecorder (request_rec *request, InPlaceResourceRecorder *recorder) |
Context for handling a request, computing options and request headers in the constructor.
|
static |
This must be called on any InPlaceResourceRecorder allocated by instaweb_handler before calling DoneAndSetHeaders() on it.
bool net_instaweb::InstawebHandler::HandleAsInPlace | ( | ) |
Attempts to handle this as an in-place resource. Returns false if the in-place handling didn't occur, and another handler should take over the request.
void net_instaweb::InstawebHandler::HandleAsPagespeedResource | ( | ) |
Unconditionally handles a resource that looks like a .pagespeed. resource, whether the result is success or failure.
bool net_instaweb::InstawebHandler::HandleAsProxy | ( | ) |
Attempts to handle this as a proxied resource (see MapProxyDomain). Returns false if the proxy handling didn't occur, and another handler should take over the request.
|
static |
Handle mod_pagespeed-specific requests. Handles both .pagespeed. rewritten resources and /mod_pagespeed_statistics, /mod_pagespeed_beacon, etc.
|
static |
By default, apache imposes limitations on URL segments of around 256 characters that appear to correspond to filename limitations. To prevent that, we hook map_to_storage for our own purposes.
|
static |
Was this request made by mod_pagespeed itself? If so, we should not try to handle it, just let Apache deal with it like normal.
RewriteDriver* net_instaweb::InstawebHandler::MakeDriver | ( | ) |
Makes a driver from the request_context and options. Note that this can only be called once, as it potentially mutates the options as it transfers ownership of custom_options.
ApacheFetch* net_instaweb::InstawebHandler::MakeFetch | ( | const GoogleString & | url | ) |
Allocates a Fetch object associated with the current request and the specified URL.
|
inline |
Allocates a Fetch object associated with the current request and its URL.
|
inline |
Returns the options, whether they were custom-computed due to htaccess file, query params, or headers, or were the default options for the vhost.
bool net_instaweb::InstawebHandler::ProxyUrl | ( | ) |
Loads the URL based on the fetchers and other infrastructure in the factory, returning true if the request was handled. This is used both for slurping and for handling URLs ending with proxy_suffix.
|
static |
Save the original URL as a request "note" before mod_rewrite has a chance to corrupt mod_pagespeed's generated URLs, which would prevent instaweb_handler from being able to decode the resource.
|
static |
Implementation of the Apache 'translate_name' hook. Used by the actual hook 'save_url_hook' and directly when we already have the server context.