Page Speed Optimization Libraries
1.5.27.2
|
Public Member Functions | |
FileInputResource (ServerContext *server_context, const RewriteOptions *options, const ContentType *type, const StringPiece &url, const StringPiece &filename) | |
virtual bool | IsValidAndCacheable () const |
virtual void | FillInPartitionInputInfo (HashHint include_content_hash, InputInfo *input) |
Set OutputPartition's input info used for expiration validation. | |
virtual GoogleString | url () const |
Gets the absolute URL of the resource. | |
virtual const RewriteOptions * | rewrite_options () const |
virtual bool | UseHttpCache () const |
Protected Member Functions | |
void | SetDefaultHeaders (const ContentType *content_type, ResponseHeaders *header, MessageHandler *handler) |
virtual void | LoadAndCallback (NotCacheablePolicy not_cacheable_policy, AsyncCallback *callback, MessageHandler *message_handler) |
virtual bool net_instaweb::FileInputResource::IsValidAndCacheable | ( | ) | const [virtual] |
Uses default no-op Freshen implementation because file-based resources are fetched each time they are needed.
Reimplemented from net_instaweb::Resource.
virtual void net_instaweb::FileInputResource::LoadAndCallback | ( | NotCacheablePolicy | not_cacheable_policy, |
AsyncCallback * | callback, | ||
MessageHandler * | message_handler | ||
) | [protected, virtual] |
Load the resource asynchronously, storing ResponseHeaders and contents in object. Calls 'callback' when finished. The ResourcePtr used to construct 'callback' must be the same as the resource used to invoke this method.
Setting not_cacheable_policy to kLoadEvenIfNotCacheable will permit it to consider loading to be successful on Cache-Control:private and Cache-Control:no-cache resources. It should not affect /whether/ the callback gets involved, only whether it gets true or false.
Implements net_instaweb::Resource.
virtual const RewriteOptions* net_instaweb::FileInputResource::rewrite_options | ( | ) | const [inline, virtual] |
Obtain rewrite options for this. Any resources which return true for UseHttpCache() but don't unconditionally return true for loaded() must override this in a useful way. Used in cache invalidation.
Implements net_instaweb::Resource.
virtual bool net_instaweb::FileInputResource::UseHttpCache | ( | ) | const [inline, virtual] |
Returns whether this type of resource should use the HTTP Cache. This method is based on properties of the class, not the resource itself, and helps short-circuit pointless cache lookups for file-based and data URLs.
Implements net_instaweb::Resource.