Performance: Image and file handling
HIGH IMPACT
This affects page load speed and interaction responsiveness by controlling how images and files are loaded and rendered on the page.
image_tag @user.avatar.variant(resize_to_limit: [300, 300]), loading: 'lazy', alt: 'User avatar'
image_tag @user.avatar.url, loading: 'eager'| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Eager loading full-size images | Minimal | 1 per image | High due to large decode | [X] Bad |
| Lazy loading resized images | Minimal | 1 per image | Low due to smaller decode | [OK] Good |
| Synchronous file processing on request | N/A | N/A | Blocks server response | [X] Bad |
| Asynchronous background file processing | N/A | N/A | Non-blocking | [OK] Good |