Integration on Mobile app

This documentation explains which Accept Headers needs to be included for Images in Mobile App. This allows you to optimize images specifically for Nitrogen AIO delivery.

Prerequisites#

  • You must have a domain configured on Nitrogen
  • You must have AIO enabled, please refer this article .
  • Basic understanding of Mobile App Image Properties and Nitrogen AIO.

Steps#

Add the following Headers on outgoing image requests. Please modify the values based on the user’s mobile device and network configuration:

X-Device-Dpr = 1
X-Device-Format = image/avif,image/webp,image/jpeg,image/png
X-Device-Ram = 4096
X-Device-Width = 980
X-Device-Bandwidth = 10
X-Device-Type = app

Description:

  • X-Device-Type: is mandatory and must be set to app for all image requests originating from the mobile application.
  • The remaining headers are optional but strongly recommended to achieve the best optimization results.
  • If any optional header is omitted, N7 AIO falls back to its default behavior:
    • X-Device-Dpr: (default: 1)
      • Specifies the screen’s device pixel ratio to serve the right image quality.
    • X-Device-Bandwidth: (default: high)
      • Indicates the device’s current internet speed in megabytes per second (Mbps).
    • X-Device-Width: (Default: Original image width)
      • Tells the server the ideal image width of the device screen (in pixels).
    • X-Device-Ram: (Default: high)
      • Shares how much available RAM the device has (in MBs).
    • X-Device-Format: (Default: Original image format)
      • Specifies the image formats supported and available on the device for optimized delivery, such as webp or avif.

Notes#

  1. Please ensure that your image-serving domain is pointing to N7.

  2. If you are using an N7 domain for AIO optimization, ensure that all image URLs are served through the N7 domain.