Page Speed Optimization Libraries  1.8.31.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
net_instaweb::ApacheFetch Class Reference

#include "instaweb_handler.h"

Inheritance diagram for net_instaweb::ApacheFetch:
net_instaweb::AsyncFetchUsingWriter net_instaweb::AsyncFetch

List of all members.

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)

Detailed Description

Links an apache request_rec* to an AsyncFetch, adding the ability to block based on a condition variable.


Member Function Documentation

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.

Todo:
TODO(nikhilmadan): Consider making this virtual so that subclass authors are forced to look at this function.

Reimplemented from net_instaweb::AsyncFetch.

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.

Todo:
TODO(jmarantz): consider allowing serf fetches in ipro when running as a reverse-proxy.
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.

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.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines