Performance: Logout view
LOW IMPACT
This affects the page load speed and user interaction responsiveness when ending a user session.
from django.contrib.auth import logout from django.http import JsonResponse def logout_view(request): logout(request) return JsonResponse({'success': True})
from django.contrib.auth import logout from django.shortcuts import redirect def logout_view(request): logout(request) return redirect('/login/')
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Logout with redirect | Full DOM rebuild | Multiple reflows | High paint cost | [X] Bad |
| Logout with JSON | Minimal DOM update | Single reflow | Low paint cost | [OK] Good |