Search code examples
http-headerstornadohttp-caching

A parallel for Django's @never_cache in Tornado


What would be the canonical way to implement a parallel of Django's @never_cache for Tornado's RequestHandler.get()?


Solution

  • Perhaps it's enough to override RequestHandler.compute_etag() to return None? As in:

    class BaseHandler(RequestHandler):
    
        def compute_etag(self):
            return None
    

    This seems to do the trick in local development.