Last Mile Acceleration (LMA) compresses content before delivery to the end user when the requesting client—the browser or device—supports gzip decompression. This can provide significant improvement in transfer times to clients with slow connections.
Your property reviews the request header in a client request for the
Accept-Encoding: gzip entry. If it's included, this indicates that the requesting client can decompress gzip content. The property then reviews what's set as Compression Response to determine how to deliver content to the client.
What it does
Select whether to compress responses to clients that support gzip. Eligible clients include the
If you’re using a custom origin, the Same origin as response option is affected by your setting for Supports Gzip Compression in the Origin Server behavior. The Same as origin response option always uses whatever you have set for Supports Gzip Compression for the applicable origin server.
860 bytes is the smallest object that Akamai edge servers will gzip compress and serve to the client. Any smaller than this, and the overhead required to compress and decompress the content eliminates any advantage gained by compression. Keep this in mind when adding LMA to your property. Ideally, you should add LMA to compress objects that are greater than 4.2 KB in size, and are these file types:
If your file content falls within the list above, you can quickly add a separate rule that presets the Content Type match criteria to include all of these file types as well as several others that are supported for compression. It includes the Last Mile Acceleration (Gzip Compression) behavior and sets Compress Response to Always.
In Property Configuration Settings, click Add Rule.
Set Available Rules (by Category) to All.
In Search available rules, type minimize and select the Minimize payload rule.
Click the Compressible objects rule entry to see the added rule and its match criteria.
Click Insert Rule to add it to your property.
Don’t use LMA compression for any of these files types:
Small files. This includes anything smaller than 860 bytes in size, regardless of file type.
Content that is already compressed. This includes Gzip, .zip, .7z, etc. The system attempts to compress this content, even though it’s already compressed, and it won’t decrease its size. This will just delay the delivery of the content.
PDFs. If LMA tries to compress a PDF, an error is thrown.
Image files. We recommend against this, even if you think they’ll compress. If you're working with JPEG images, consider using Adaptive Image Compression to compress your images.
Chunked content. This includes any content that's delivered as
content-encoding: chunked. If your property includes the Chunked Transfer Encoding behavior, you need to ensure that any rule's Criteria that contains the LMA behavior excludes any file formats that may be chunked. To be sure that you're safe—and you're only including LMA-supported file formats—apply LMA by including the Minimize payload rule.
Streaming media content. Often, this content is compressed for delivery using other means. It won’t benefit from LMA compression.
Streaming media assets such as manifest files and closed captioning files for HLS and DASH format media can fall into the “
text/” related compression categories. Compression of these files can result in poor performance or break stream delivery. To accommodate this, best practices settings are automatically applied in the background for Adaptive Media Delivery properties that may include LMA compression. However, we recommend that you avoid including this behavior in your Adaptive Media Delivery properties because it’s not intended for use with streaming media content.
If you add LMA to an existing property that's already delivering content, you should purge any cached content before you go live to production with the updated property. If you don't, you won't see the benefit of the compression. Your property may continue to deliver larger, uncompressed content from cache, impacting delivery time.
With LMA enabled and after you perform this purge, there may be a noticeable increase in traffic to your origin until edge server caches have been refreshed with compressed content.
Updated 6 months ago