Worked example
Initial image bytes: 300
Inputs
- Image byte sizes in page order: 100,200,300,400
- Initially loaded image numbers (1-based): 1,2
- Remaining images reached by scrolling (%): 50
Initial image indices are unique.
Use the units shown.
Sum sizes at the initially loaded indices.
Add the first roundUp(remaining count × scroll percentage/100) remaining images to initial bytes.
Sum all image byte sizes.
Eager-load bytes minus scenario total.
Initial image indices are unique. The scenario loads the stated fraction of remaining images in page order, rounding the number upward. It estimates transferred image bytes, not browser behavior, network time or actual user scroll patterns.
OpenStax: percentages and proportions ↗Initial image bytes: 300
Initial image bytes: 10