-
-
Save iOS0x00/7114496 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tornado.web | |
class NoCacheStaticFileHandler(tornado.web.StaticFileHandler): | |
def set_extra_headers(self, path): | |
self.set_header("Cache-control", "no-cache") | |
class Application(tornado.web.Application): | |
def __init__(self): | |
handlers = [ | |
# ... | |
url(r"/static/(.*)", | |
tornado.web.StaticFileHandler if not options.debug else NoCacheStaticFileHandler, { | |
"path": '/var/www/static' | |
}, name="static") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment