Image Optimizer Specifications¶
1. Basic behavior¶
The images used on the site are automatically compressed, and the compressed files are hosted and distributed via a CDN (AWS CloudFront) managed by Repro. This reduces the file size of image data when loading the site, resulting in improved page load speed.
The use of this feature only changes the loading speed of images on the site and does not affect the functionality or behavior of the site itself.
The converted images are cached on the CDN managed by Repro for a certain period of time, and when the cache expires, the original images are retrieved, converted, cached, and used again. If you wish to check or change the expiration date, please contact us.
Images will only be reformatted and compressed, and will not be resized or cropped to change the image size (number of pixels).
Images to be converted can be specified and excluded by target URLs and excluded URLs. For images matching the excluded URLs, the original image will be used as is.
In this case, Repro's CDN is not used, and the original image is directly used.
2. Image format¶
The conversion source files are
.jpg
,.jpeg
, and.png
, and the conversion formats are WebP and AVIF.The original logic in the Booster SDK determines if the browser supports WebP/AVIF, and the result will determine the format to use.
Only file extensions are used to determine the image format.
Unsupported image formats such as
.gif
will not be converted and the original image will be used as is.For files hosted on a CDN that have a
.jpg
extension but contain WebP, conversion may or may not be performed.
3. Cache behavior on CDNs¶
When caching converted images on a CDN managed by Repro, the following cleansing process is performed on the cached content.
Remove the
Set-Cookie
header from the original image.A
Cache-Control: max-age
header is added, with an optional expiration date specified by us. If the specified value is less than 1 hour, it will be overwritten to 1 hour.A
Cache-Control: s-maxage
header is added, and any expiration time specified by us is set to 0.9 multiples of the specified value.Add a
Cache-Control: stale-while-revalidate, stale-if-error
header with an optional expiration time specified by us of twice the value.Set the
Access-Control-Allow-Origin
header to the source origin (≈domain of the site).
The URL is used as the key for caching.
The key URL for caching includes the query parameter, but not the hash.
Query parameters are used in a sorted form.
4. Misc¶
In the case of images with fixed URLs but different content depending on the accessing browser, the version obtained by the Image Optimizer conversion server may be used by other browsers as well.
Conversion will not be performed if any of the following conditions are met
The file size of the original image exceeds 10 MB.
The size of the original image exceeds 16.8 megapixels.
Conversion may not be performed if the image is so small that there is no point in converting it, such as an image that is less than 16x16 pixels in size.
If an error occurs due to conversion failure or no response from the origin server, the result may be cached on the Image Optimizer server for a short period of time to reduce the load on the origin.
If an error occurs in the response from the Image Optimizer server returning content to the Booster SDK (conversion failure, timeout, etc.), the SDK will make a direct request (fallback) to the origin server.