AVIF Arrives, Sanity’s Promise Fulfilled
Blog post from Sanity
Sanity has introduced AVIF support for image transformations, offering superior compression compared to JPEG and WebP, which results in smaller file sizes and faster load times without compromising visual quality. This enhancement is particularly beneficial for mobile devices and slower networks. When an image is requested using the auto=format parameter, Sanity checks if the browser supports AVIF and aims to deliver an AVIF image if available. To ensure a quick experience, a non-blocking format like WebP or JPEG is initially provided if the AVIF version is not ready, while the image is asynchronously queued for AVIF conversion and later served from cache on subsequent requests. This approach balances fast initial load times with optimized AVIF benefits for future visitors, reflecting Sanity's commitment to delivering features that enhance user experience, even if it takes time to fulfill such promises.