Managing Usage & Costs
Learn how to measure and manage Image Optimization usage with this guide to avoid any unexpected costs.Your Image Optimization usage is displayed under the Image Optimization section of the Usage tab on your dashboard.
To help you minimize image optimization usage costs, you can use the following tips:
-
Image Cache Max Age: If your images do not change in less than a month, set
max-age=2592000
(30 days) in theCache-Control
header or setminimumCacheTTL
tominimumCacheTTL:2592000
in Next.js configuration to reduce the number of transformations and revalidation costs. Using static imports can also help as they set theCache-Control
header to 1 year. -
Remote and local patterns: Configure remote and local allowlist patterns in Next.js to identify which images should be optimized so that you can limit unnecessary transformations.
-
Quality settings: Configure the images.qualities allowlist in Next.js configuration to reduce possible transformations.
-
Image sizes: Define size related allowlists for images to avoid excessive resizing. Set the
imageSizes
anddeviceSizes
in Next.js configuration to match your audience and reduce the number of transformations. -
unoptimized
property: For images that transformations will not benefit from optimization such as small images, vector images (SVG) and animated images (GIF), use theunoptimized
property in Next.js.
Was this helpful?