Page Speed Optimization Libraries
1.13.35.1
|
Public Member Functions | |
virtual bool | UseHttpCache () const |
All the public methods here implement the Resource API. More... | |
virtual bool | IsValidAndCacheable () const |
virtual void | LoadAndCallback (NotCacheablePolicy not_cacheable_policy, const RequestContextPtr &request_context, AsyncCallback *callback) |
This checks the cache, and fetches the resource if appropriate. | |
virtual void | Freshen (FreshenCallback *callback, MessageHandler *handler) |
virtual void | RefreshIfImminentlyExpiring () |
virtual GoogleString | url () const |
Gets the absolute URL of the resource. | |
virtual GoogleString | cache_key () const |
Public Member Functions inherited from net_instaweb::Resource | |
Resource (const RewriteDriver *driver, const ContentType *type) | |
ServerContext * | server_context () const |
Common methods across all deriviations. | |
bool | is_authorized_domain () |
void | set_is_authorized_domain (bool is_authorized) |
bool | IsSafeToRewrite (bool rewrite_uncacheable, GoogleString *reason) const |
bool | IsSafeToRewrite (bool rewrite_uncacheable) const |
bool | loaded () const |
bool | HttpStatusOk () const |
void | LoadAsync (NotCacheablePolicy not_cacheable_policy, const RequestContextPtr &request_context, AsyncCallback *callback) |
GoogleString | ContentsHash () const |
void | AddInputInfoToPartition (HashHint suggest_include_content_hash, int index, CachedResult *partition) |
virtual void | FillInPartitionInputInfo (HashHint suggest_include_content_hash, InputInfo *input) |
void | FillInPartitionInputInfoFromResponseHeaders (const ResponseHeaders &headers, InputInfo *input) |
int64 | CacheExpirationTimeMs () const |
StringPiece | ExtractUncompressedContents () const |
size_t | UncompressedContentsSize () const |
StringPiece | raw_contents () const |
ResponseHeaders * | response_headers () |
const ResponseHeaders * | response_headers () const |
const ContentType * | type () const |
virtual void | SetType (const ContentType *type) |
bool | IsContentsEmpty () const |
StringPiece | charset () const |
Note: this is empty if the header is not specified. | |
void | set_charset (StringPiece c) |
virtual bool | has_url () const |
virtual GoogleString | UrlForDebug () const |
Override if resource does not have a URL. | |
void | DetermineContentType () |
bool | Link (HTTPValue *source, MessageHandler *handler) |
void | LinkFallbackValue (HTTPValue *value) |
Links the stale fallback value that can be used in case a fetch fails. | |
void | set_is_background_fetch (bool x) |
bool | is_background_fetch () const |
FetchResponseStatus | fetch_response_status () |
void | set_fetch_response_status (FetchResponseStatus x) |
Public Member Functions inherited from net_instaweb::RefCounted< Resource > | |
void | Release () |
void | AddRef () |
bool | HasOneRef () |
Protected Member Functions | |
CacheableResourceBase (StringPiece stat_prefix, StringPiece url, StringPiece cache_key, const ContentType *type, RewriteDriver *rewrite_driver) | |
Note: InitStats(stat_prefix) must have been called before. | |
virtual void | PrepareRequest (const RequestContextPtr &request_context, RequestHeaders *headers) |
virtual void | PrepareResponseHeaders (ResponseHeaders *headers) |
HTTPCache * | http_cache () const |
RewriteDriver * | rewrite_driver () const |
const RewriteOptions * | rewrite_options () const |
bool | ShouldSkipBackgroundFetch () const |
Protected Member Functions inherited from net_instaweb::Resource | |
REFCOUNT_FRIEND_DECLARATION (Resource) | |
void | set_enable_cache_purge (bool x) |
ResponseHeaders::VaryOption | respect_vary () const |
void | set_respect_vary (ResponseHeaders::VaryOption x) |
void | set_proactive_resource_freshening (bool x) |
void | set_disable_rewrite_on_no_transform (bool x) |
Static Protected Member Functions | |
static void | InitStats (StringPiece stat_prefix, Statistics *statistics) |
Friends | |
class | CacheableResourceBaseTest |
Additional Inherited Members | |
Public Types inherited from net_instaweb::Resource | |
enum | HashHint { kOmitInputHash, kIncludeInputHash } |
enum | NotCacheablePolicy { kLoadEvenIfNotCacheable, kReportFailureIfNotCacheable } |
Protected Attributes inherited from net_instaweb::Resource | |
ServerContext * | server_context_ |
const ContentType * | type_ |
GoogleString | charset_ |
HTTPValue | value_ |
contains contents and meta-data | |
ResponseHeaders | response_headers_ |
HTTPValue | fallback_value_ |
|
inlinevirtual |
Gets the cache key for resource. This may be different from URL if the resource is e.g. UA-dependent.
Reimplemented from net_instaweb::Resource.
|
virtual |
Freshen a soon-to-expire resource so that we minimize the number of cache misses when serving live traffic. Note that callback may be NULL, and all subclasses must handle this.
Reimplemented from net_instaweb::Resource.
|
virtual |
Checks if the contents are loaded and valid and also if the resource is up-to-date and cacheable by a proxy like us.
Reimplemented from net_instaweb::Resource.
|
protectedvirtual |
Permits the subclass to alter request headers or request context used for a fetch. Default implementation does nothing.
Reimplemented in net_instaweb::GoogleFontServiceInputResource.
|
protectedvirtual |
Permits the subclass to alter the response headers returned from a fetch before the entry gets added to the cache. Default implementation does nothing. Note: ComputeCaching hasn't been called yet at time this is invoked.
Reimplemented in net_instaweb::GoogleFontServiceInputResource.
|
virtual |
If the resource is about to expire from the cache, re-fetches the resource in background to try to prevent it from expiring.
Base implementation does nothing, since most subclasses of this do not use caching.
Reimplemented from net_instaweb::Resource.
|
protected |
Returns a bool indicating whether we should skip triggering a background fetch.
|
inlinevirtual |
All the public methods here implement the Resource API.
All subclasses of this use the HTTP cache.
Implements net_instaweb::Resource.