Page Speed Optimization Libraries  1.7.30.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends
net_instaweb::CacheableResourceBase Class Reference
Inheritance diagram for net_instaweb::CacheableResourceBase:
net_instaweb::Resource net_instaweb::GoogleFontServiceInputResource net_instaweb::UrlInputResource

List of all members.

Public Member Functions

virtual bool UseHttpCache () const
 All the public methods here implement the Resource API.
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

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)
HTTPCachehttp_cache () const
RewriteDriverrewrite_driver () const
const RewriteOptionsrewrite_options () const
bool ShouldSkipBackgroundFetch () const

Static Protected Member Functions

static void InitStats (StringPiece stat_prefix, Statistics *statistics)

Friends

class CacheableResourceBaseTest

Member Function Documentation

virtual GoogleString net_instaweb::CacheableResourceBase::cache_key ( ) const [inline, virtual]

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 void net_instaweb::CacheableResourceBase::Freshen ( FreshenCallback callback,
MessageHandler *  handler 
) [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.

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.

virtual void net_instaweb::CacheableResourceBase::PrepareRequest ( const RequestContextPtr &  request_context,
RequestHeaders *  headers 
) [protected, virtual]

Permits the subclass to alter request headers or request context used for a fetch. Default implementation does nothing.

Reimplemented in net_instaweb::GoogleFontServiceInputResource.

virtual void net_instaweb::CacheableResourceBase::PrepareResponseHeaders ( ResponseHeaders *  headers) [protected, virtual]

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.

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.

Returns a bool indicating whether we should skip triggering a background fetch.

virtual bool net_instaweb::CacheableResourceBase::UseHttpCache ( ) const [inline, virtual]

All the public methods here implement the Resource API.

All subclasses of this use the HTTP cache.

Implements net_instaweb::Resource.


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