Browse Source

[core] Add ConditionalGetMiddleware

This middleware adds Content-Length to the response, and
adds ETag awareness, which we can eventually use to allow
the browser to cache pages.
Erick Tryzelaar 11 năm trước cách đây
mục cha
commit
f79e4d4
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      desktop/core/src/desktop/settings.py

+ 2 - 1
desktop/core/src/desktop/settings.py

@@ -128,7 +128,8 @@ MIDDLEWARE_CLASSES = [
     'desktop.middleware.ClusterMiddleware',
     'django.middleware.transaction.TransactionMiddleware',
     # 'debug_toolbar.middleware.DebugToolbarMiddleware'
-    'django.middleware.csrf.CsrfViewMiddleware'
+    'django.middleware.csrf.CsrfViewMiddleware',
+    'django.middleware.http.ConditionalGetMiddleware',
 ]
 
 if os.environ.get(ENV_DESKTOP_DEBUG):