Image Delivery: The Real-World Process

When a page is loaded, the browser and the server work together to decide which image is finally delivered to the user.
The delivery process happens in four sequential stages.
Stage 1: HTML Parsing (What the Page Provides)
What Happens:
- 1. The browser parses the HTML.
- 2. It discovers image references.
imgtagspicturetags (if used)
Important Point
At this stage:
- No image format is chosen yet
- No image size is chosen yet
The browser only knows what options are available.
Stage 2: Responsive Candidate Evaluation (Size Decision)
This stage happens before format replacement.
What Happens
The browser evaluates:
- Layout width (CSS pixels)
- Device Pixel Ratio (DPR)
- Available responsive breakpoints (srcset)
Then it selects: The most suitable image size candidate.
Responsive breakpoints are generated and managed by CompressX.
CompressX prepares a set of image size candidates based on your configuration.
The browser evaluates these candidates and selects the most suitable size for the current device.
Stage 3: Image Request (Browser → Server)
What Happens
- The browser sends an image request.
- The requested URL is still: JPEG or PNG (Original image path)
The browser does not request “WebP” or “AVIF” explicitly in most cases.
Stage 4: Image Replacement (Format Decision)
What Happens
The server decides whether to replace the image format.
CompressX can apply one of the following strategies:
- Option: Rewrite Rule Mode
Returns WebP or AVIF if supported (avif -> webp ->jpg/png). - Option:
pictureTag Mode
Returns WebP or AVIF if supported (avif -> webp ->jpg/png). - Option: Compatible Rewrite Rule Mode
New thumbnails will be generated without watermarks, including JPG, PNG, WebP, and AVIF versions.
Image replacement happens after the browser has already decided the image size.
Stage 5: Image Delivery to the User
Final Result
The browser receives:
- A specific image size.
- In the best supported format
This means:
- Format optimization ≠ size optimization.
- Both must work together
Key Takeaway (Process-Oriented)
- Image delivery follows a strict order.
- Size selection always happens before format replacement
- WebP / AVIF alone does not guarantee fast loading
- Breakpoints are critical on mobile, tablet and desktop devices


