Package flumotion :: Package component :: Package misc :: Package httpserver :: Package httpcached :: Module strategy_basic :: Class CachingStrategy
[hide private]

Class CachingStrategy

source code

  extern.log.log.Loggable --+    
                            |    
strategy_base.CachingStrategy --+
                                |
                               CachingStrategy

Simplistic caching strategy where all requested streams are cached when requested.

On each cache-miss, a caching session is created and started right away.

When a cached file expire, a new session is created with the condition that it has been modified. If not the cached file is used and keep alive, if it succeed the cached file is deleted and a new caching session is created and started.

Updates the caching statistics.

Instance Methods [hide private]
 
__init__(self, cachemgr, reqmgr, ttl) source code
 
_onCacheMiss(self, url, stats) source code
 
_onCacheOutdated(self, url, identifier, cachedFile, stats) source code
 
_reallyOutdated(self, session, url, identifier, cachedFile, stats) source code
 
_maybeNotOutdated(self, failure, url, identifier, cachedFile, stats) source code
 
_filterErrors(self, failure) source code
 
_cbCreateSource(self, session, stats) source code

Inherited from strategy_base.CachingStrategy: cleanup, getSessions, getSourceFor, keepCacheAlive, requestData, setup

Inherited from extern.log.log.Loggable: __providedBy__, __provides__, debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure, writeMarker

Class Variables [hide private]
  logCategory = 'basic-caching'
Implementors can provide a category to log their messages under.

Inherited from extern.log.log.Loggable: __implemented__

Method Details [hide private]

__init__(self, cachemgr, reqmgr, ttl)
(Constructor)

source code 
Overrides: strategy_base.CachingStrategy.__init__

_onCacheMiss(self, url, stats)

source code 
Overrides: strategy_base.CachingStrategy._onCacheMiss

_onCacheOutdated(self, url, identifier, cachedFile, stats)

source code 
Overrides: strategy_base.CachingStrategy._onCacheOutdated