Performance: Clickjacking protection
This concept affects page security and user interaction safety without directly impacting page load speed or rendering performance.
Jump into concepts and practice - no test required
from django.views.decorators.clickjacking import xframe_options_deny @xframe_options_deny def my_view(request): return render(request, 'my_template.html')
from django.views.decorators.clickjacking import xframe_options_exempt @xframe_options_exempt def my_view(request): return render(request, 'my_template.html')
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No clickjacking protection | 0 | 0 | 0 | [!] OK but insecure |
| Using @xframe_options_exempt decorator | 0 | 0 | 0 | [X] Bad - insecure |
| Using @xframe_options_deny decorator | 0 | 0 | 0 | [OK] Good - secure |
| Using XFrameOptionsMiddleware globally | 0 | 0 | 0 | [OK] Good - secure |
@xframe_options_exempt decorator to a view but clickjacking protection still blocks framing. What is the likely cause?@xframe_options_exempt decorator only works if the XFrameOptionsMiddleware is active.