ImageEngine offers a handy way to let you know more about how an image is optimized. By appending a specific HTTP header to an image request, ImageEngine will return additional metadata. This metadata is useful when verifying the ImageEngine implementation, debugging settings, or simply running a quick audit.
General ImageEngine Response Headers
To verify that ImageEngine serves an image request, ImageEngine includes these response headers as part of the response:
Response Header | Value |
---|---|
server |
Always ScientiaMobile ImageEngine |
x-ie-cache |
HIT or MISS |
imgeng-hash |
A unique hash representing this image |
imgeng-img-status |
The optimization status of the image. Possible values are:optimized : the optimized version is served,origin-object : a temporary state where ImageEngine serves the original image until the optimized version is available. |
If an error occurs at the origin when ImageEngine tries to fetch the image for the first time, the following response headers offer a reason:
Response Header | Description |
---|---|
x-origin-reason |
An explanation of the error |
x-origin-status |
An HTTP status code received from the origin server |
Requesting Additional Information From ImageEngine
To receive a response with the additional metadata, add this HTTP header to the request: imgeng-audit: true
.
With curl, the request could look like this:
curl -I -H "imgeng-audit:true" https://xxxyyy123.cdn.imgeng.in/path/image.png
xxxyyy123.cdn.imgeng.in
refers to your delivery address for the engine you want to debug.
For convenience, you may also use a browser plugin that will add the header for each request automatically so that you can inspect the responses from ImageEngine in the Developer Tools or similar. One such plugin is ModHeader, available for Chrome-based browsers, Edge, and Opera.
When ImageEngine receives a request with imgeng-audit: true
, inspecting an image in your browser will additionally display the headers in the table below:
Response Header | Description |
---|---|
imgeng-image-source |
States from which layer of the cache Imageengine retrieved the image. Possible values are external ,origin-cached , processed-cached and frontend |
imgeng-origin-cache |
Describes if a copy of the original image was present in the origin cache. Possible values: HIT , MISS |
imgeng-dpi-old |
The default DPI or DPR used to calculate optimal compression level. Values from 1 to 4 . |
imgeng-dpi-new |
The actual DPI used by the optimization algorithm to calculate optimal compression level. The DPI value may change because of poor origin image quality. Values from 1 to 4 . |
imgeng-bytes |
The byte size of the optimized image |
imgeng-bytes-origin |
The byte size of the origin image |
imgeng-format |
The image format of the optimized image |
imgeng-format-origin |
The image format of the original image as served by the origin server |
imgeng-resolution |
The image resolution in pixels produced by ImageEngine. width xheight |
imgeng-resolution-origin |
The image resolution in pixels of the original image. width xheight |
server-timing |
May contain server timing metrics related to serving the image from the front end cache. For example: frontendcachehit;dur=0.180662;desc="Time spent fetching object from the frontend cache" |
backend-server-timing |
May contain server timing metrics related to fetching, optimizing the image |
imgeng-matched-uas |
Lists all custom settings that are matching the current request. For example: corsao=*|corsah=*|corsam=GET |
Comments
0 comments
Please sign in to leave a comment.