Skip to content

Instantly share code, notes, and snippets.

@gilsondev
Created July 21, 2012 16:12
Show Gist options
  • Save gilsondev/3156291 to your computer and use it in GitHub Desktop.
Save gilsondev/3156291 to your computer and use it in GitHub Desktop.
Middleware que impede o cache da página pelo navegador (bom para desenvolvimento)
class NoCacheMiddleware(object):
def process_response(self, request, response):
request.META['HTTP_CACHE_CONTROL'] = "no-cache"
return response
# ...
MIDDLEWARE_CLASSES += (
'project_app.utils.middleware.NoCacheMiddleware',
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment