Adaptive Loading: Optimize for Device & Network
Adaptive loading tailors the user experience based on real device capabilities and network conditions. Detect fast/slow networks, high/low-end devices, and save-data mode to deliver optimized images, code bundles, and features — ensuring great performance for everyone.
Fast customers (4G + high-end device) get the full tasting menu with premium ingredients. Slow customers (3G or low-end device) get a lighter but still delicious version. Customers who asked for “save data” mode get the efficient set menu. Everyone leaves satisfied.
1Network Information API
Use navigator.connection to detect effectiveType (4g/3g/2g), downlink speed, RTT, and saveData preference.
const connection = navigator.connection; console.log(connection.effectiveType); // '4g' console.log(connection.saveData); // true/false
2Device Capabilities Detection
Use navigator.deviceMemory and navigator.hardwareConcurrency to classify devices as high/mid/low-end and adjust features accordingly.
3Adaptive Image & Code Loading
Serve lower quality images or lighter bundles on slow networks/low-end devices. Use dynamic imports for heavy features.
4Save Data Mode & Best Practices
Respect navigator.connection.saveData. Progressively enhance from baseline experience. Always provide graceful degradation.
| Property | High-End (4G + 8GB+) | Low-End / Slow Network |
|---|---|---|
| Code | Heavy bundles + Web Workers | Minimal bundles + lazy loading |
| Images | High quality / AVIF | Low quality / WebP |
| Features | Full experience + animations | Core features only |
High-End (4G + 8GB+)
Code
Heavy bundles + Web Workers
Images
High quality / AVIF
Features
Full experience + animations
Low-End / Slow Network
Code
Minimal bundles + lazy loading
Images
Low quality / WebP
Features
Core features only
Common questions
- ›“How do you optimize for users on slow networks or low-end devices?”
- ›“Explain the Network Information API and how you would use it.”
- ›“How do you respect Save Data mode?”
- ›“What trade-offs do you consider in adaptive loading?”
What interviewers look for
- Practical use of navigator.connection and device capabilities
- Progressive enhancement mindset
- Respect for user preferences (save-data)
- Balance between performance and experience
Short answer (60 sec)
Use navigator.connection to detect network quality and saveData mode. Combine with deviceMemory and hardwareConcurrency to serve lighter assets and simpler features on slow/low-end devices while progressively enhancing for better conditions.
Detailed answer (senior level)
Adaptive loading uses real client signals (effectiveType, saveData, deviceMemory, hardwareConcurrency) to deliver the right experience. Serve low-res images and minimal code on slow connections, full features on fast devices. Respect save-data preference by reducing quality and disabling non-essential features. This improves Core Web Vitals across all users and shows thoughtful product engineering.
- Ignoring slow networks and low-end devices
- Not respecting saveData mode
- Serving high-res images to all users
- Loading heavy features unconditionally
- Assuming all users have modern high-end devices
- ✓Detect network with navigator.connection.effectiveType
- ✓Respect saveData preference for reduced data usage
- ✓Classify devices using deviceMemory and hardwareConcurrency
- ✓Serve appropriate image quality and code bundles
- ✓Progressively enhance from a solid baseline experience
- ✓Adaptive loading improves inclusivity and Core Web Vitals
- ✓Always test on real devices and throttled networks