Commits

Gregory Petukhov  committed 71451ca

Add disable_cache decorator

  • Participants
  • Parent commits 5183b3e

Comments (0)

Files changed (1)

File common/decorators.py

         else:
             return response
     return wrapper
+
+
+def disable_cache(func):
+    def decorated(*args, **kwargs):
+        resp = func(*args, **kwargs)
+        resp['Pragma'] = 'no-cache'
+        resp['Expires'] = '0'
+        resp['Cache-Control'] = 'no-cache, no-store, must-revalidate'
+        return resp
+    return decorated