Some requests require no session, auth, locale, csrf check, message, or many other middlewares. Especially, there are some useless db connection in django_session for some requests. Exclude unnecessary middlewares can make the requests go much faster.
但是這個作法的還是只有部分選擇性,一次必須跳過所有再內層的的 middleware,另外,如果想用讓某幾個 view 使用某些 middleware 且為數較少的話,應該使用 decorator_from_middleware
另外即使跳過 process_view or process_request 也無法跳過 process_response ,必須另外做處理
沒有留言:
張貼留言