Page Speed Optimization Libraries
1.8.31.2
|
#include "instaweb_handler.h"
Public Member Functions | |
ApacheFetch (const GoogleString &mapped_url, ServerContext *server_context, request_rec *request, const RequestContextPtr &request_context, const RewriteOptions *options) | |
void | set_handle_error (bool x) |
virtual void | HandleHeadersComplete () |
virtual void | HandleDone (bool success) |
void | Wait () |
bool | status_ok () const |
virtual bool | IsCachedResultValid (const ResponseHeaders &headers) |
void | set_is_proxy (bool x) |
Links an apache request_rec* to an AsyncFetch, adding the ability to block based on a condition variable.
virtual bool net_instaweb::ApacheFetch::IsCachedResultValid | ( | const ResponseHeaders & | headers | ) | [virtual] |
Is the cache entry corresponding to headers valid? Default is that it is valid. Sub-classes can provide specific implementations, e.g., based on cache invalidation timestamp in domain specific options. Used by CacheUrlAsyncFetcher.
Reimplemented from net_instaweb::AsyncFetch.
void net_instaweb::ApacheFetch::set_handle_error | ( | bool | x | ) | [inline] |
When used for in-place resource optimization in mod_pagespeed, we have disabled fetching resources that are not in cache, otherwise we may wind up doing a loopback fetch to the same Apache server. So the CacheUrlAsyncFetcher will return a 501 or 404 but we do not want to send that to the client. So for ipro we suppress resporting errors in this flow.
void net_instaweb::ApacheFetch::set_is_proxy | ( | bool | x | ) | [inline] |
By default ApacheFetch is not intended for proxying third party content. When it is to be used for proxying third party content, we must avoid sending a 'nosniff' header.
void net_instaweb::ApacheFetch::Wait | ( | ) |
Blocks indefinitely waiting for the proxy fetch to complete. Every 'blocking_fetch_timeout_ms', log a message so that if we get stuck there's noise in the logs, but we don't expect this to happen because underlying fetch/cache timeouts should fire.
Note that enforcing a timeout in this function makes debugging difficult.