Page Speed Optimization Libraries
1.7.30.4
|
#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 |
void | SetupSpdyConnectionIfNeeded () |
void | RemoveStrippedResponseHeadersFromApacheReequest () |
RewriteDriver * | MakeDriver () |
ApacheFetch * | MakeFetch (const GoogleString &url) |
ApacheFetch * | MakeFetch () |
bool | HandleAsProxy () |
bool | HandleAsInPlace () |
void | HandleAsPagespeedResource () |
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 void net_instaweb::InstawebHandler::AboutToBeDoneWithRecorder | ( | request_rec * | request, |
InPlaceResourceRecorder * | recorder | ||
) | [static] |
This must be called on any InPlaceResourceRecorder allocated by instaweb_handler before calling DoneAndSetHeaders() on it.
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.
Unconditionally handles a resource that looks like a .pagespeed. resource, whether the result is success or failure.
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 apr_status_t net_instaweb::InstawebHandler::instaweb_handler | ( | request_rec * | request | ) | [static] |
Handle mod_pagespeed-specific requests. Handles both .pagespeed. rewritten resources and /mod_pagespeed_statistics, /mod_pagespeed_beacon, etc.
static apr_status_t net_instaweb::InstawebHandler::instaweb_map_to_storage | ( | request_rec * | request | ) | [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 bool net_instaweb::InstawebHandler::is_pagespeed_subrequest | ( | request_rec * | request | ) | [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.
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.
ApacheFetch* net_instaweb::InstawebHandler::MakeFetch | ( | ) | [inline] |
Allocates a Fetch object associated with the current request and its URL.
const SystemRewriteOptions* net_instaweb::InstawebHandler::options | ( | ) | [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.
static apr_status_t net_instaweb::InstawebHandler::save_url_hook | ( | request_rec * | request | ) | [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 apr_status_t net_instaweb::InstawebHandler::save_url_in_note | ( | request_rec * | request, |
ApacheServerContext * | server_context | ||
) | [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.