Page Speed Optimization Libraries  1.9.32.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
net_instaweb::WriteThroughHTTPCache Class Reference

Composes two cache interfaces to form a two level http cache. More...

#include "write_through_http_cache.h"

Inheritance diagram for net_instaweb::WriteThroughHTTPCache:
net_instaweb::HTTPCache

Public Member Functions

 WriteThroughHTTPCache (CacheInterface *cache1, CacheInterface *cache2, Timer *timer, Hasher *hasher, Statistics *statistics)
 Takes ownership of both caches passed in.
 
virtual void SetIgnoreFailurePuts ()
 Implements HTTPCache::SetIgnoreFailurePuts().
 
virtual void Find (const GoogleString &key, const GoogleString &fragment, MessageHandler *handler, Callback *callback)
 Implements HTTPCache::Find().
 
virtual void DeleteInternal (const GoogleString &key_fragment)
 Implements HTTPCache::DeleteInternal().
 
virtual void set_force_caching (bool force)
 Implements HTTPCache::set_force_caching().
 
virtual void set_hasher (Hasher *hasher)
 Implements HttpCache::set_hasher().
 
virtual void set_disable_html_caching_on_https (bool x)
 Implements HTTPCache::set_disable_html_caching_on_https().
 
virtual void set_remember_not_cacheable_ttl_seconds (int64 value)
 Implements HTTPCache::set_remember_not_cacheable_ttl_seconds().
 
virtual void set_remember_fetch_failed_ttl_seconds (int64 value)
 Implements HTTPCache::set_remember_fetch_failed_ttl_seconds().
 
virtual void set_remember_fetch_dropped_ttl_seconds (int64 value)
 Implements HTTPCache::set_remember_fetch_dropped_ttl_seconds();.
 
virtual void set_max_cacheable_response_content_length (int64 value)
 Implements HTTPCache::set_max_cacheable_response_content_length().
 
virtual void RememberNotCacheable (const GoogleString &key, const GoogleString &fragment, bool is_200_status_code, MessageHandler *handler)
 Implements HTTPCache::RememberNotCacheable().
 
virtual void RememberFetchFailed (const GoogleString &key, const GoogleString &fragment, MessageHandler *handler)
 Implements HTTPCache::RememberFetchFailed().
 
virtual void RememberFetchDropped (const GoogleString &key, const GoogleString &fragment, MessageHandler *handler)
 Implements HTTPCache::RememberFetchDropped().
 
void set_cache1_limit (size_t limit)
 
size_t cache1_limit () const
 
virtual GoogleString Name () const
 
- Public Member Functions inherited from net_instaweb::HTTPCache
 HTTPCache (CacheInterface *cache, Timer *timer, Hasher *hasher, Statistics *stats)
 Does not take ownership of any inputs.
 
void Put (const GoogleString &key, const GoogleString &fragment, RequestHeaders::Properties req_properties, const HttpOptions &http_options, HTTPValue *value, MessageHandler *handler)
 
void Put (const GoogleString &key, const GoogleString &fragment, RequestHeaders::Properties req_properties, ResponseHeaders::VaryOption respect_vary_on_resources, ResponseHeaders *headers, const StringPiece &content, MessageHandler *handler)
 
virtual void Delete (const GoogleString &key, const GoogleString &fragment)
 Deletes an element in the cache.
 
bool force_caching () const
 
Timer * timer () const
 
bool IsCacheableContentLength (ResponseHeaders *headers) const
 
bool IsCacheableBodySize (int64 body_size) const
 
bool IsExpired (const ResponseHeaders &headers)
 
bool IsExpired (const ResponseHeaders &headers, int64 now_ms)
 
Variable * cache_time_us ()
 Stats for the HTTP cache.
 
Variable * cache_hits ()
 
Variable * cache_misses ()
 
Variable * cache_fallbacks ()
 
Variable * cache_expirations ()
 
Variable * cache_inserts ()
 
Variable * cache_deletes ()
 
int64 remember_not_cacheable_ttl_seconds ()
 
int64 remember_fetch_failed_ttl_seconds ()
 
int64 remember_fetch_dropped_ttl_seconds ()
 
int max_cacheable_response_content_length ()
 

Static Public Member Functions

static GoogleString FormatName (StringPiece l1, StringPiece l2)
 
- Static Public Member Functions inherited from net_instaweb::HTTPCache
static GoogleString FormatEtag (StringPiece hash)
 Function to format etags.
 
static void InitStats (Statistics *statistics)
 Initialize statistics variables for the cache.
 
static GoogleString FormatName (StringPiece cache)
 
static GoogleString CompositeKey (StringPiece key, StringPiece fragment)
 

Static Public Attributes

static const size_t kUnlimited
 
- Static Public Attributes inherited from net_instaweb::HTTPCache
static const char kCacheTimeUs []
 Names of statistics variables: exported for tests.
 
static const char kCacheHits []
 
static const char kCacheMisses []
 
static const char kCacheBackendHits []
 
static const char kCacheBackendMisses []
 
static const char kCacheFallbacks []
 
static const char kCacheExpirations []
 
static const char kCacheInserts []
 
static const char kCacheDeletes []
 
static const char kEtagPrefix []
 The prefix used for Etags.
 

Protected Member Functions

virtual void PutInternal (const GoogleString &key, const GoogleString &fragment, int64 start_us, HTTPValue *value)
 Implements HTTPCache::PutInternal().
 

Additional Inherited Members

- Public Types inherited from net_instaweb::HTTPCache
enum  FindResult { kFound, kNotFound, kRecentFetchFailed, kRecentFetchNotCacheable }
 When a lookup is done in the HTTP Cache, it returns one of these values. More...
 

Detailed Description

Composes two cache interfaces to form a two level http cache.

Member Function Documentation

void net_instaweb::WriteThroughHTTPCache::set_cache1_limit ( size_t  limit)
inline

By default, all data goes into both cache1 and cache2. But if you only want to put small items in cache1, you can set the size limit. Note that both the key and value will count torward the size.


The documentation for this class was generated from the following file: