Page Speed Optimization Libraries
1.2.24.1
|
#include "apache_server_context.h"
Public Member Functions | |
ApacheServerContext (ApacheRewriteDriverFactory *factory, server_rec *server, const StringPiece &version) | |
GoogleString | hostname_identifier () |
ApacheRewriteDriverFactory * | apache_factory () |
ApacheConfig * | config () |
bool | InitFileCachePath () |
ApacheConfig * | SpdyConfigOverlay () |
ApacheConfig * | NonSpdyConfigOverlay () |
bool | has_spdy_config_overlay () const |
bool | has_non_spdy_config_overlay () const |
void | set_spdy_config_overlay (ApacheConfig *x) |
These two take ownership of their parameters. | |
void | set_non_spdy_config_overlay (ApacheConfig *x) |
ApacheConfig * | SpdyConfig () |
RewriteDriverPool * | spdy_driver_pool () |
void | CollapseConfigOverlaysAndComputeSignatures () |
void | CreateLocalStatistics (Statistics *global_statistics) |
void | ChildInit () |
Should be called after the child process is forked. | |
bool | initialized () const |
bool | PoolDestroyed () |
void | PollFilesystemForCacheFlush () |
void | AddHtmlRewriteTimeUs (int64 rewrite_time_us) |
const server_rec * | server () const |
Static Public Member Functions | |
static void | InitStats (Statistics *statistics) |
Creates an Apache-specific ServerContext. This differs from base class that it incorporates by adding per-VirtualHost configuration, including:
void net_instaweb::ApacheServerContext::AddHtmlRewriteTimeUs | ( | int64 | rewrite_time_us | ) |
Accumulate in a histogram the amount of time spent rewriting HTML.
This should be called after all configuration parsing is done to collapse configuration inside the config overlays into actual ApacheConfig objects. It will also compute signatures when done.
void net_instaweb::ApacheServerContext::CreateLocalStatistics | ( | Statistics * | global_statistics | ) |
Initialize this ServerContext to have its own statistics domain. Must be called after global_statistics has been created and had ::Initialize called on it.
bool net_instaweb::ApacheServerContext::has_spdy_config_overlay | ( | ) | const [inline] |
These return true if the given overlays were constructed (in response to having something in config files to put in them).
Poll; if we haven't checked the timestamp of $FILE_PREFIX/cache.flush in the past cache_flush_poll_interval_sec_ (default 5) seconds do so, and if the timestamp has expired then update the cache_invalidation_timestamp in global_options, thus flushing the cache.
TODO(jmarantz): allow configuration of this option.
TODO(jmarantz): allow a URL-based mechanism to flush cache, even if we implement it by simply writing the cache.flush file so other servers can see it. Note that using shared-memory is not a great plan because we need the cache-invalidation to persist across server restart.
Called on notification from Apache on child exit. Returns true if this is the last ServerContext that exists.
Pool to pass to NewRewriteDriverFromPool to get a RewriteDriver configured with SPDY-specific options. May be NULL in case there is no spdy-specific configuration.
ApacheConfig* net_instaweb::ApacheServerContext::SpdyConfig | ( | ) | [inline] |
Returns special configuration that should be used for SPDY sessions instead of config(). Returns NULL if config() should be used instead.
These return configuration objects that hold settings from <ModPagespeedIf spdy>=""> and <ModPagespeedIf !spdy> sections of configuration. They initialize lazily, so are not thread-safe; however they are only meant to be used during configuration parsing. These methods should be called only if there is actually a need to put something in them, since otherwise we may end up constructing separate SPDY vs. non-SPDY configurations needlessly.