Page Speed Optimization Libraries
1.9.32.1
|
Public Member Functions | |
Context (FakeFilter *filter, RewriteDriver *driver, RewriteContext *parent, ResourceContext *resource_context) | |
void | RewriteSingle (const ResourcePtr &input, const OutputResourcePtr &output) |
Subclasses of SingleRewriteContext must override this: | |
virtual void | DoRewriteSingle (const ResourcePtr input, OutputResourcePtr output) |
GoogleString | UserAgentCacheKey (const ResourceContext *resource_context) const |
virtual const char * | id () const |
Returns the filter ID. | |
virtual OutputResourceKind | kind () const |
![]() | |
SingleRewriteContext (RewriteDriver *driver, RewriteContext *parent, ResourceContext *resource_context) | |
![]() | |
RewriteContext (RewriteDriver *driver, RewriteContext *parent, ResourceContext *resource_context) | |
int | num_slots () const |
ResourceSlotPtr | slot (int index) const |
int | num_outputs () const |
OutputResourcePtr | output (int i) const |
int | num_output_partitions () const |
const CachedResult * | output_partition (int i) const |
CachedResult * | output_partition (int i) |
bool | chained () const |
void | AddSlot (const ResourceSlotPtr &slot) |
void | RemoveLastSlot () |
void | AddNestedContext (RewriteContext *context) |
void | Initiate () |
bool | Fetch (const OutputResourcePtr &output_resource, AsyncFetch *fetch, MessageHandler *message_handler) |
bool | slow () const |
bool | is_metadata_cache_miss () const |
This particular rewrite was a metadata cache miss. | |
bool | has_parent () const |
Returns true if this is a nested rewriter. | |
bool | IsNestedIn (StringPiece id) const |
RewriteContext * | parent () |
Allows a nested rewriter to walk up its parent hierarchy. | |
const RewriteContext * | parent () const |
void | set_force_rewrite (bool x) |
If called with true, forces a rewrite and re-generates the output. | |
bool | rewrite_uncacheable () const |
void | set_rewrite_uncacheable (bool rewrite_uncacheable) |
const ResourceContext * | resource_context () const |
GoogleString | ToString (StringPiece prefix) const |
Returns debug information about this RewriteContext. | |
Additional Inherited Members | |
![]() | |
typedef std::vector< InputInfo * > | InputInfoStarVector |
![]() | |
static void | InitStats (Statistics *stats) |
Initializes statistics. | |
![]() | |
static const char | kNumRewritesAbandonedForLockContention [] |
static const char | kNumDeadlineAlarmInvocations [] |
static const char | kNumDistributedRewriteSuccesses [] |
static const char | kNumDistributedRewriteFailures [] |
static const char | kNumDistributedMetadataFailures [] |
static const char | kDistributedExt [] |
The extension used for all distributed fetch URLs. | |
static const char | kDistributedHash [] |
The hash value used for all distributed fetch URLs. | |
![]() | |
typedef std::vector< GoogleUrl * > | GoogleUrlStarVector |
![]() | |
virtual bool | Partition (OutputPartitions *partitions, OutputResourceVector *outputs) |
SingleRewriteContext takes care of these methods from RewriteContext: | |
virtual void | Rewrite (int partition_index, CachedResult *partition, const OutputResourcePtr &output) |
![]() | |
ServerContext * | FindServerContext () const |
const RewriteOptions * | Options () const |
RewriteDriver * | Driver () const |
int | num_nested () const |
Accessors for the nested rewrites. | |
RewriteContext * | nested (int i) const |
OutputPartitions * | partitions () |
void | AddRecheckDependency () |
virtual bool | OptimizationOnly () const |
virtual void | PartitionAsync (OutputPartitions *partitions, OutputResourceVector *outputs) |
void | PartitionDone (RewriteResult result) |
void | CrossThreadPartitionDone (RewriteResult result) |
void | RewriteDone (RewriteResult result, int partition_index) |
virtual bool | SendFallbackResponse (StringPiece output_url_base, StringPiece contents, AsyncFetch *async_fetch, MessageHandler *handler) |
void | StartNestedTasks () |
virtual void | Harvest () |
virtual void | Render () |
virtual void | WillNotRender () |
virtual void | Cancel () |
virtual const UrlSegmentEncoder * | encoder () const |
virtual GoogleString | CacheKeySuffix () const |
virtual void | EncodeUserAgentIntoResourceContext (ResourceContext *context) |
void | AttachDependentRequestTrace (const StringPiece &label) |
RequestTrace * | dependent_request_trace () |
void | TracePrintf (const char *fmt,...) |
virtual void | StartFetchReconstruction () |
bool | ShouldDistributeRewrite () const |
bool | IsDistributedRewriteForHtml () const |
void | DistributeRewrite () |
void | DetachFetch () |
virtual bool | DecodeFetchUrls (const OutputResourcePtr &output_resource, MessageHandler *message_handler, GoogleUrlStarVector *url_vector) |
virtual void | FixFetchFallbackHeaders (const CachedResult &cached_result, ResponseHeaders *headers) |
virtual void | FetchCallbackDone (bool success) |
virtual void | FetchTryFallback (const GoogleString &url, const StringPiece &hash) |
void | Freshen () |
Freshens resources proactively to avoid expiration in the near future. | |
bool | notify_driver_on_fetch_done () const |
void | set_notify_driver_on_fetch_done (bool value) |
bool | block_distribute_rewrite () const |
void | set_block_distribute_rewrite (const bool x) |
AsyncFetch * | async_fetch () |
Note that the following must only be called in the fetch flow. | |
bool | FetchContextDetached () |
Is fetch_ detached? Only call this in the fetch flow. | |
MessageHandler * | fetch_message_handler () |
The message handler for the fetch. | |
bool | stale_rewrite () const |
Indicates whether we are serving a stale rewrite. | |
virtual int64 | GetRewriteDeadlineAlarmMs () const |
virtual bool | CreationLockBeforeStartFetch () |
Should the context call LockForCreation before checking the cache? | |
![]() | |
static bool | LookupMetadataForOutputResourceImpl (OutputResourcePtr output_resource, const GoogleUrl &gurl, RewriteContext *rewrite_context, RewriteDriver *driver, GoogleString *error_out, CacheLookupResultCallback *callback) |
|
inlinevirtual |
Rewrites come in three flavors, as described in output_resource_kind.h, so this method must be defined by subclasses to indicate which it is.
For example, we will avoid caching output_resource content in the HTTP cache for rewrites that are so quick to complete that it's fine to do the rewrite on every request. extend_cache is obviously in this category, and it's arguable we could treat js minification that way too (though we don't at the moment).
Implements net_instaweb::RewriteContext.
|
virtual |
Indicates user agent capabilities that must be stored in the cache key.
Note that the context may be NULL as it may not be set before this. Since it isn't going to be modified in the method, ResourceContext is passed as a const pointer.
Reimplemented from net_instaweb::RewriteContext.