Skip to content

Add network quality detection and adaptive request throttling #283

@RUKAYAT-CODER

Description

@RUKAYAT-CODER

Background

The app uses useNetworkStatus hook. Enhance to detect network quality (3G vs 4G vs WiFi), throttle requests, reduce image quality, and adjust prefetch strategies based on detected connection quality.

Description

Detect network quality and adapt request behavior (throttle, reduce image quality, prefetch strategy).

Current Behavior

Same request patterns regardless of 3G/4G/WiFi. No adaptation.

Expected Behavior

On 3G: throttle requests, lower image quality. On WiFi: aggressive prefetch.

Impact

📶 Better performance on slow networks
💡 Reduced bandwidth usage
⚡ Smoother experience across connection types

Acceptance Criteria

  • Use expo-network to detect connection type and speed
  • Classify: slow 3G, fast-3G, 4G, 5G, WiFi
  • Throttle API request concurrency based on quality
  • Reduce image quality for slow connections
  • Disable aggressive prefetch on slow connections
  • Test with Network Throttling in DevTools
  • Monitor performance metrics by connection type
  • Document adaptive strategy

Implementation Hints

Enhance useNetworkStatus hook. Detect network type with expo-network. Adjust image URLs (e.g., ?quality=low). Control prefetch aggressiveness.

Performance Metrics

Before:

  • slowNetworkExp: 2MB image on 3G network: 50+ seconds

After (Target):

  • slowNetworkExp: Reduced quality image: 8 seconds (-84%)

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions