Page Speed Optimization Libraries
1.7.30.3
|
#include "async_fetch.h"
Public Member Functions | |
ConditionalSharedAsyncFetch (AsyncFetch *base_fetch, HTTPValue *cached_value, MessageHandler *handler) | |
void | set_num_conditional_refreshes (Variable *x) |
Protected Member Functions | |
virtual void | HandleDone (bool success) |
virtual bool | HandleWrite (const StringPiece &content, MessageHandler *handler) |
virtual bool | HandleFlush (MessageHandler *handler) |
virtual void | HandleHeadersComplete () |
Creates a SharedAsyncFetch object using an existing AsyncFetch and a cached value (that may be stale) that is used to conditionally check if the resource at the origin has changed. If the resource hasn't changed and we get a 304, we serve the cached response, thus avoiding the download of the entire content. Note that we if you want the conditionally validated resource to be treated as a newly fetched with the original ttl, you should use this fetch such that the fixing of date headers happens in the base fetch. Also, note that this class gets deleted when HandleDone is called.