MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / enable_cache

Method enable_cache

src/ext/sockjs/tornado/basehandler.py:53–60  ·  view source on GitHub ↗

Enable client-side caching for the current request

(self)

Source from the content-addressed store, hash-verified

51
52 # Various helpers
53 def enable_cache(self):
54 """Enable client-side caching for the current request"""
55 self.set_header('Cache-Control', 'max-age=%d, public' % CACHE_TIME)
56
57 d = datetime.datetime.now() + datetime.timedelta(seconds=CACHE_TIME)
58 self.set_header('Expires', d.strftime('%a, %d %b %Y %H:%M:%S'))
59
60 self.set_header('access-control-max-age', CACHE_TIME)
61
62 def disable_cache(self):
63 """Disable client-side cache for the current request"""

Callers 3

optionsMethod · 0.80
getMethod · 0.80
getMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected