Performance: STATIC_URL and STATICFILES_DIRS
MEDIUM IMPACT
This concept affects how static files are served and loaded, impacting page load speed and caching efficiency.
STATIC_URL = '/static/' STATICFILES_DIRS = [BASE_DIR / 'static'] # Clear directory for static files # Static files are collected and served efficiently
STATIC_URL = '/static/' STATICFILES_DIRS = [] # No directories specified # Static files are scattered or not collected properly
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No STATICFILES_DIRS or disorganized static files | No direct impact | No direct impact | Delays paint due to missing CSS/JS | [X] Bad |
| Proper STATICFILES_DIRS with STATIC_URL | No direct impact | No direct impact | Fast paint due to quick static asset load | [OK] Good |