Page Speed Optimization Libraries
1.7.30.2
|
Public Member Functions | |
CachePropertyStore (const GoogleString &cache_key_prefix, CacheInterface *cache, Timer *timer, Statistics *stats, ThreadSystem *thread_system) | |
virtual void | Get (const GoogleString &url, const GoogleString &options_signature_hash, const GoogleString &cache_key_suffix, const PropertyCache::CohortVector &cohort_list, PropertyPage *page, BoolCallback *done, AbstractPropertyStoreGetCallback **callback) |
virtual void | Put (const GoogleString &url, const GoogleString &options_signature_hash, const GoogleString &cache_key_suffix, const PropertyCache::Cohort *cohort, const PropertyCacheValues *values, BoolCallback *done) |
Write to cache. | |
void | AddCohort (const GoogleString &cohort) |
Establishes a Cohort backed by the CacheInteface passed to the constructor. | |
void | AddCohortWithCache (const GoogleString &cohort, CacheInterface *cache) |
GoogleString | CacheKey (const StringPiece &url, const StringPiece &options_signature_hash, const StringPiece &cache_key_suffix, const PropertyCache::Cohort *cohort) const |
const CacheInterface * | cache_backend () |
Returns default cache backend associated with CachePropertyStore. | |
Static Public Attributes | |
static const char | kPagePropertyCacheKeyPrefix [] |
Property cache key prefixes. |
net_instaweb::CachePropertyStore::CachePropertyStore | ( | const GoogleString & | cache_key_prefix, |
CacheInterface * | cache, | ||
Timer * | timer, | ||
Statistics * | stats, | ||
ThreadSystem * | thread_system | ||
) |
Does not take the ownership of cache, timer and stats object. L2-only caches should be used for CachePropertyStore. We cannot use the L1 cache because this data can get stale quickly.
void net_instaweb::CachePropertyStore::AddCohortWithCache | ( | const GoogleString & | cohort, |
CacheInterface * | cache | ||
) |
Establishes a Cohort to be backed by the specified CacheInterface. Does not take the ownership of cache.
GoogleString net_instaweb::CachePropertyStore::CacheKey | ( | const StringPiece & | url, |
const StringPiece & | options_signature_hash, | ||
const StringPiece & | cache_key_suffix, | ||
const PropertyCache::Cohort * | cohort | ||
) | const |
Gets the underlying key associated with cache_key and a Cohort. This is the key used for the CacheInterface provided to the constructor. This is made visible for testing, to make it possible to inject delays into the cache via DelayCache::DelayKey.
virtual void net_instaweb::CachePropertyStore::Get | ( | const GoogleString & | url, |
const GoogleString & | options_signature_hash, | ||
const GoogleString & | cache_key_suffix, | ||
const PropertyCache::CohortVector & | cohort_list, | ||
PropertyPage * | page, | ||
BoolCallback * | done, | ||
AbstractPropertyStoreGetCallback ** | callback | ||
) | [virtual] |
Cache lookup is initiated for the given cohort and results are populated in PropertyPage if it is valid. callback paramter can be set to NULL if cohort_list is empty.
Implements net_instaweb::PropertyStore.