<s> """<STR_LIT>""" <EOL> from django . utils . decorators import decorator_from_middleware <EOL> from django . utils . cache import patch_cache_control , add_never_cache_headers <EOL> from django . middleware . cache import CacheMiddleware <EOL> cache_page = decorator_from_middleware ( CacheMiddleware ) <EOL> def cache_control ( ** kwargs ) : <EOL> def _cache_controller ( viewfunc ) : <EOL> def _cache_controlled ( request , * args , ** kw ) : <EOL> response = viewfunc ( request , * args , ** kw ) <EOL> patch_cache_control ( response , ** kwargs ) <EOL> return response <EOL> return _cache_controlled <EOL> return _cache_controller <EOL> def never_cache ( view_func ) : <EOL> """<STR_LIT>""" <EOL> def _wrapped_view_func ( request , * args , ** kwargs ) : <EOL> response = view_func ( request , * args , ** kwargs ) <EOL> add_never_cache_headers ( response ) <EOL> return response <EOL> return _wrapped_view_func </s>
