Test image optimizations and transformations
In order to test image optimizations before pushing them live, you can create a sandbox for an Akamai property that has Image Manager enabled. Then, modify the config.json
for your sandbox to override the origin mappings to point to the origin that hosts your pristine images. The origin could be a local file directory or a cloud storage repository.
Once you have your sandbox set up, start sending traffic through the sandbox using your favorite client (browser, curl, etc.), The first time you send traffic, no images will be cached. Any requests for images that would be handled by Image Manager and require pristine images are sent back to sandbox-client
, which runs on the local developer machine as shown. On subsequent requests, sandbox-client
consults the config.json
to resolve the origin mapping and fetch the pristine image.
Image Manager applies the selected real-time transformation to the pristine image, and then the transformed image is sent back to sandbox-client
.
Depending on the caching rules you’ve applied, the transformed image may be cached in the sandbox development environment. Sandbox provides cache key isolation at the sandbox level, which gives you the ability to test transformations of the same image while working in parallel with your developer colleagues.
With this method, you can iteratively test your changes and get quick feedback on image optimizations, which can inform updates for your property settings.
Verify the image transformation
To verify, send a request to the origin directly with no sandbox, as shown. The Content-Length
header contains the original size of the image without any transformations.
Then, send a request with the Sandbox + Image Manager combination. Besides other headers, the Content-Length
header shows the size of the transformed image to be less than when served with only the Image Manager transformation.
You can also send Akamai pragma headers with the request, and check for certain special response headers. The response headers (outlined in red) confirm that the image was transformed in real time in the Sandbox environment:
Server: Akamai Image Server
X-Akamai-Sandbox: true
X-Image-Server-Product: IM
Depending on the caching rules defined in your sandbox, subsequent requests for the same image could be served from the cache, which should contain the earlier transformed image.
Finally, you can also use Piez to validate Image Manager behaviors.
Use HTTPS for testing
When testing Sandbox with Image Manager, you need to use the edgekey.net
suffix, so traffic is served over secure HTTPS.
To learn more about setting up a CNAME for the request hostname, refer to edgekey.net.
The
auto-format
conversion andperceptual-quality
optimizations are not supported in Sandbox.
Updated about 2 years ago