Performance: Performance optimization
This affects page load speed, rendering time, and user interaction responsiveness by optimizing how Bootstrap CSS and JS are loaded and used.
<link rel="stylesheet" href="/css/bootstrap-custom.min.css"> <script defer src="/js/bootstrap.bundle.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css"> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Full Bootstrap CSS & JS | Low (static CSS) | 1 (initial layout) | High (large CSS paint) | [X] Bad |
| Custom Bootstrap CSS + deferred JS | Low | 1 | Medium (smaller CSS paint) | [OK] Good |
img-fluid to make images scale with their container.img-fluid applies max-width: 100% and height: auto for responsiveness and performance.<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"/> <img src="large-photo.jpg" class="img-fluid" alt="Sample"/>
img-fluid class makes the image scale responsively to container width.<link href="bootstrap.css" rel="stylesheet"/> <script src="bootstrap.js"></script> <!-- All Bootstrap components included -->
Pass the test and this pattern moves unknown