Performance: Media library management
MEDIUM IMPACT
This affects page load speed and interaction responsiveness when loading and managing media files in the WordPress admin and frontend.
Use pagination or infinite scroll with lazy loading thumbnails sized appropriately for display.
Query all media files without pagination or lazy loading, loading full-size images for thumbnails.
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Loading all media at once with full-size images | High (100+ nodes) | Multiple reflows | High paint cost due to large images | [X] Bad |
| Paginated media loading with thumbnails | Moderate (20-30 nodes per page) | Single reflow per page | Low paint cost with small images | [OK] Good |
| Embedding full-size images in posts | Low DOM nodes | Minimal reflows | High paint cost due to large images | [X] Bad |
| Using responsive images with srcset | Low DOM nodes | Minimal reflows | Low paint cost with optimized images | [OK] Good |