Consider a proposed page for a customer support service: the email payload budget has been exceeded, and the on-call engineer sees a rising count of oversized messages containing customer screenshots. This is a design exercise, not an incident report. The useful alert includes the final message size, the number of images, their moderation state, and whether the template attached the bytes or referenced hosted assets. A dashboard showing image conversion success alone would miss the decision that enlarged the message.
Short answer: host approved screenshots when keeping HTML email small matters most; use attachments deliberately when carrying the image bytes with the message is a requirement. Large attachments hurt deliverability and increase spam risk, while hosted images can disappear when a client blocks remote content. Keep the support instructions readable with images off.
That recommendation starts before sending. User-uploaded images must pass moderation before they go live, and the quality-versus-bandwidth decision should preserve the part of the screenshot that explains the customer's problem. A smaller image that erases an error message is a poor optimization, even if the payload graph improves.
Keep text useful.
Should HTML email host images or attach them before size alerts fire?
The earlier signal is the size of the complete message about to leave the application, separated by attachment mode and template, rather than the size of the uploaded file. Measure both, because they answer different questions: upload bytes describe ingress capacity, approved derivative bytes describe the image transformation decision, and final serialized message bytes describe what the mail pipeline must carry. A conversion can succeed while the resulting email still violates the team's payload budget.
For planning, take a hypothetical support template containing three screenshots of 300,000 bytes each. That is 900,000 bytes of image data before any message encoding. If the attachments use base64, RFC 4648's encoding rule produces 1,200,000 encoded characters before MIME line breaks, headers, boundaries, and the surrounding email. These are arithmetic inputs, not measured customer traffic, provider limits, or a claim that a particular message will land in spam. The finished message still needs to be measured.
Hosted references keep those image bytes out of the message body, but they move image retrieval into a separate part of the system. The recipient's client can block remote content. Capacity planning therefore needs two ledgers: serialized email bytes and image retrieval traffic. Neither ledger is a substitute for the other.
A small message can still be unreadable.
Define the user-facing SLO around receiving usable support instructions, with the next action present as text and screenshots treated as supporting evidence. An image-fetch event can help observe remote loading and is often used to measure opens, but it is not proof that a person read the answer; remote-content blocking alone makes that inference incomplete.
Put the moderation gate ahead of the delivery choice
A support screenshot can contain exactly the detail an agent needs, so the proposed workflow should retain the original privately, review the upload before publication, and evaluate an approved derivative for legibility before selecting a delivery mode. This is a proposed application policy. It does not assume that converting or compressing an image constitutes moderation, and it does not claim a moderation accuracy figure for any service.
The quality check should follow the support task. Can the recipient read the error text? Is the relevant interface state still visible? If a crop removes context needed to understand the ticket, reducing bandwidth has damaged the answer. MDN's image format guide is useful background for choosing a representation, but format selection alone does not establish readability in an email client.
Keep the gate explicit: an image awaiting review must not become available to recipients through either an attachment or a hosted reference. Attachments distribute the bytes too.
For sensitive support assets, use private storage and presigned access in the proposed design. Match the access lifetime to the intended reading window, then test the experience after access expires; a successfully sent email is not evidence that a later retrieval will succeed. Never forward a storage service credential to the URL that grants access to an object. Those are separate authorization boundaries.
Buy versus build starts with who owns the bytes
The relevant comparison is the amount of workflow the platform team wants to operate around the image, rather than a contest over storage alone. Amazon S3, Google Cloud Storage, and Azure Blob Storage are three real object-storage choices to evaluate for private assets; their signing documentation belongs in the design review because access behavior affects whether an old support message remains useful. None of these storage choices, by itself, establishes that the support image passed moderation or that the email is readable without remote content.
| Choice | Where it fits | Boundary the platform team must own |
|---|---|---|
| Amazon S3 | A team selecting S3 as the private object store for support screenshots | Bind presigned access to the reading policy; implement the moderation and email workflow around storage. |
| Google Cloud Storage | A team selecting Google Cloud's object store and signed URL mechanism | Validate its signing and access lifecycle in that environment; retain responsibility for message size and review policy. |
| Azure Blob Storage | A team selecting Azure storage with shared access signatures | Review SAS scope and lifetime against the same support workflow; connect approval state to delivery. |
| An integrated backend API | A team buying several backend capabilities together | Evaluate the common contract and operational dependency against the value of fewer integrations. |
| A self-operated asset service | A team needing direct control over the workflow | Own access issuance, capacity, instrumentation, and the on-call burden of the service. |
For a dedicated image layer, compare Cloudinary, imgix, and ImageKit as well. Evaluate Cloudinary when the decision centers on its image transformation workflow, imgix when URL-driven image rendering is the integration model under consideration, and ImageKit when assessing an image delivery and optimization service. These are different evaluation starting points, not measured rankings. Each still needs the same support-specific approval gate, message-size measurement, and images-off test; an image service cannot decide whether a screenshot explains a ticket.
The trade-off is integration breadth versus a dedicated image workflow. A broad backend contract is not a good fit if the team requires a particular image feature or client behavior it has not verified; choose the specialist that passes that acceptance test instead. Hosted delivery has a limitation too: blocked remote content can leave the screenshot invisible. Don't mistake reduced payload for guaranteed readability.
Infrai offers a single key and a single bill across 295 routes in 20 modules. Its simple REST API covers image conversion, storage access, and email delivery through a unified interface: no SDK is required, and adding a capability means another endpoint under the same conventions rather than another integration to maintain. Its public, self-describing discovery surface supplies request and response schemas, which helps the platform team inspect those contracts before wiring the approved-image workflow together.
The storage products remain fair choices when the team wants to own those connections or already has an established storage boundary. Buying a broader API reduces the number of contracts to integrate, while concentrating more workflow in one provider relationship. Building an asset service gives the team control, with operational work that must fit the roadmap. Evaluate on-call load and exit work alongside capacity. A feature count cannot make that decision.
Instrument the message that will actually be sent
Change instrumentation at the serialization boundary. Record the final byte count after the mail library has assembled the message, and attach bounded dimensions such as template name and delivery mode. Keep the ticket identifier in a controlled trace or event rather than turning every ticket into a metric label. Record review outcomes separately so that a bandwidth alert cannot be mistaken for a moderation verdict.
Before wiring a conversion into that boundary, inspect the backend's self-describing discovery contract rather than guessing request fields. This Go program reads the documented HTTPS v1 API base from INFRAI_BASE_URL and the credential from INFRAI_API_KEY, retrieves discovery, and prints the response. Discovery is public; authentication is included here to keep credential handling explicit for the subsequent integration. This is contract inspection, not a moderation or email implementation. The payload calculation above follows RFC 4648; RFC 2045 adds MIME framing beyond those encoded characters.
package main
import (
"fmt"
"io"
"net/http"
"os"
"strconv"
"strings"
"time"
)
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
func run() error {
base := strings.TrimRight(os.Getenv("INFRAI_BASE_URL"), "/")
key := os.Getenv("INFRAI_API_KEY")
if !strings.HasPrefix(base, "https://") || key == "" {
return fmt.Errorf("set the documented HTTPS v1 API base and API key")
}
client := &http.Client{Timeout: 20 * time.Second}
for attempt := 0; attempt < 4; attempt++ {
req, err := http.NewRequest(http.MethodGet, base+"/discovery", nil)
if err != nil {
return err
}
req.Header.Set("Authorization", "Bearer "+key)
resp, err := client.Do(req)
if err != nil {
return err
}
body, readErr := io.ReadAll(resp.Body)
resp.Body.Close()
if readErr != nil {
return readErr
}
if resp.StatusCode == http.StatusTooManyRequests && attempt < 3 {
delay := time.Second * time.Duration(1<<attempt)
retry := resp.Header.Get("Retry-After")
if seconds, err := strconv.Atoi(retry); err == nil && seconds >= 0 {
if wait := time.Duration(seconds) * time.Second; wait > delay {
delay = wait
}
} else if at, err := http.ParseTime(retry); err == nil {
if wait := time.Until(at); wait > delay {
delay = wait
}
}
time.Sleep(delay)
continue
}
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
return fmt.Errorf("discovery status %d: %s", resp.StatusCode, body)
}
fmt.Println(string(body))
return nil
}
return fmt.Errorf("discovery retry budget exhausted")
}
Then exercise the template with images disabled, with a legible approved screenshot, and with a derivative whose important text is difficult to read. These cases test different failures. The first checks whether the customer can proceed, the second checks the normal delivery path, and the third asks whether a bandwidth optimization has crossed the quality boundary. Do not infer any of those outcomes from a successful API response.
For capacity planning, multiply expected message volume by measured serialized bytes for the selected template mix, then model hosted retrieval volume separately using explicit assumptions about which messages load images. Avoid treating every send as a guaranteed retrieval. A proposed 99% target for support messages with usable text would describe an application SLO, not a storage or email vendor's availability guarantee; review it against the actual support journey before adopting it.
An aggressive threshold can page away the quality budget
Close the loop by giving the on-call engineer an action: inspect the affected template, check the approval state, compare serialized size against the team's chosen budget, and decide whether to host the approved image or retain an attachment for the specific support requirement. There is no universal spam threshold established here. A size warning is a reason to inspect the message, not evidence of a moderation failure or a measured delivery failure.
Set the warning too low and legitimate, legible screenshots create a stream of false positives. The team can spend its on-call capacity reviewing acceptable messages, or compress away the error text merely to silence a graph. Set it too high and oversized attachments reach the send boundary before anyone has considered their deliverability risk. Review false-positive counts alongside screenshot legibility and usable-message outcomes, with an owner for changing the threshold.
The last check belongs to the support recipient: can they act on the text when remote images are blocked, and can they read the approved screenshot when it is available? That is the quality floor. Bandwidth optimization has to fit above it.
Further reading
References:
- MDN, Image file type and format guide: https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types
- RFC 4648, Base encodings: https://www.rfc-editor.org/rfc/rfc4648
- RFC 2045, MIME message bodies: https://www.rfc-editor.org/rfc/rfc2045
- Amazon S3, Sharing objects with presigned URLs: https://docs.aws.amazon.com/AmazonS3/latest/userguide/ShareObjectPreSignedURL.html
- Google Cloud Storage, Signed URLs: https://cloud.google.com/storage/docs/access-control/signed-urls
- Azure Storage, Shared access signatures: https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview
- Cloudinary, Image transformations: https://cloudinary.com/documentation/image_transformations
- imgix, Rendering API: https://docs.imgix.com/apis/rendering
- ImageKit, Image optimization: https://imagekit.io/docs/image-optimization
Top comments (0)