Changeset 1057
- Timestamp:
- 04/22/06 15:23:01
- Files:
-
- trunk/cherrypy/config.py (modified) (1 diff)
- trunk/cherrypy/lib/caching.py (modified) (2 diffs)
- trunk/cherrypy/test/test_core.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/config.py
r1055 r1057 101 101 reset() 102 102 103 def get(key, default_value=None, return_section=False, path =None):103 def get(key, default_value=None, return_section=False, path=None): 104 104 """Return the configuration value corresponding to key 105 105 If specified, return default_value on lookup failure. If return_section is trunk/cherrypy/lib/caching.py
r1054 r1057 1 1 import Queue 2 2 import threading 3 import Queue4 3 import time 5 4 … … 105 104 cherrypy.request.cached = c = bool(cacheData) 106 105 if c: 107 serve_cache(cacheData) 106 expirationTime, lastModified, obj = cacheData 107 modifiedSince = cherrypy.request.headers.get('If-Modified-Since', None) 108 if modifiedSince is not None and modifiedSince == lastModified: 109 cherrypy._cache.totNonModified += 1 110 cherrypy.response.status = "304 Not Modified" 111 cherrypy.response.body = None 112 else: 113 # serve it & get out from the request 114 cherrypy.response.status, cherrypy.response.header_list, body = obj 115 cherrypy.response.body = body 108 116 return c 109 110 def serve_cache(cacheData):111 expirationTime, lastModified, obj = cacheData112 modifiedSince = cherrypy.request.headers.get('If-Modified-Since', None)113 if modifiedSince is not None and modifiedSince == lastModified:114 cherrypy._cache.totNonModified += 1115 cherrypy.response.status = "304 Not Modified"116 cherrypy.response.body = None117 else:118 # serve it & get out from the request119 cherrypy.response.status, cherrypy.response.header_list, body = obj120 cherrypy.response.body = body121 117 122 118 def tee_output(): trunk/cherrypy/test/test_core.py
r1047 r1057 351 351 }, 352 352 '/internalredirect/secure': { 353 ' auth.on': True,353 'tools.auth.on': True, 354 354 }, 355 355 '/error': {

