Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

Dramatically Improve Website Speed with CDN × Image Optimization — Implementation Patterns and Cost-Effectiveness Guide

Table of contents · 6 items

When a website feels slow, the first area to address is images. According to research by HTTP Archive, images account for 50% to 70% of total web page transfer size. In other words, simply optimizing images can potentially cut total site transfer volume roughly in half.

Display speed directly affects business results. Data shows that a 1-second delay in page load time reduces conversion rates (CVR) by approximately 7%, and if it takes over 3 seconds, roughly 40% of users abandon the page. Put another way, image optimization is the website improvement initiative with the highest ROI.

This article explains acceleration techniques combining CDNs (Content Delivery Networks) and image optimization across different implementation patterns, including their cost-effectiveness.


Images govern website loading speed — Why image optimization is the top priority

Among Google's Core Web Vitals, LCP (Largest Contentful Paint) is the central metric for measuring page loading performance. The primary cause of slow LCP is unoptimized images, and Google considers an LCP under 2.5 seconds to be "Good."

The reason image optimization is so effective for LCP is simple. The largest element measured on a page is often the hero image or main visual banner. Reducing the file size of this image and speeding up its delivery directly improves LCP.

While techniques for improving Core Web Vitals are systematically covered in our Practical Guide to Core Web Vitals Optimization, this article focuses on the highest-impact lever among them: Images × CDN.

What is a CDN? — Its role in image delivery

A CDN (Content Delivery Network) is an infrastructure that caches content on globally distributed servers (edge servers) and delivers it from the server nearest to the user.

Normally, accessing a server located in Tokyo from Osaka versus Hokkaido results in response latency differences proportional to physical distance. Using a CDN serves cached images from edge servers close to each user, minimizing delays caused by physical distance.

Furthermore, modern CDNs go beyond simple cache delivery. "Image optimization CDNs" that perform format conversion, resizing, and compression in real time at the edge are becoming the standard. By uploading just one original image, the CDN automatically generates and serves images in the optimal size and format based on the requesting device and browser.


Four implementation patterns for CDN × image optimization

Image optimization implementations can be broadly categorized into four patterns. Choose the best pattern based on your site's scale, tech stack, and budget.

Pattern 1: Built-in CDN (Cloudflare Images / Vercel Image Optimization)

In this pattern, image optimization capabilities are built directly into the CDN service itself. Setup requires only DNS configuration or platform integration, eliminating the need to build additional infrastructure.

How it works: The CDN receives user requests and inspects the Accept header to determine browser format support. It then automatically converts and delivers the image in the optimal format among AVIF, WebP, or JPEG.

Best-fit scenarios: Websites already using Cloudflare or Vercel, or teams seeking to keep technical configuration to a minimum.

Pattern 2: Image transformation SaaS (imgix / Cloudinary)

This pattern uses dedicated SaaS platforms specialized in image transformation and delivery. Image processing parameters are specified via URL query parameters, supporting advanced operations like resizing, cropping, filtering, and watermarking.

How it works: Specify transformations using query parameters in the image URL (e.g., ?w=800&fm=avif&q=75). The SaaS generates the image in real time and delivers it via CDN.

Best-fit scenarios: Sites with large volumes of images, such as e-commerce platforms, or applications requiring flexible cropping and manipulation.

Pattern 3: Self-hosted (Sharp + CloudFront)

In this pattern, an image transformation library (such as Sharp or libvips) runs on self-managed servers or Lambda functions, paired with a general-purpose CDN like CloudFront.

How it works: Image transformations run inside Lambda@Edge or CloudFront Functions, saving the converted images to an S3 cache. Subsequent requests are served directly from cache.

Best-fit scenarios: Teams already running AWS infrastructure who want complete control over image processing logic.

Pattern 4: Built-in SSG (Astro Image / Next.js Image)

This pattern uses image optimization components built into static site generators (SSGs) or web frameworks. Because images are optimized at build time, runtime processing costs are zero.

How it works: Build steps convert source images into WebP/AVIF across multiple dimensions while automatically generating <picture> tags and srcset. Notable examples include Astro's <Image> component and Next.js's next/image. For guidance on framework selection, see our Next.js vs. Astro Comparison.

Best-fit scenarios: Static sites, Jamstack architectures, or websites where images are updated infrequently.

Comparison table of the 4 patterns

ItemBuilt-in CDNImage Transformation SaaSSelf-HostedBuilt-in SSG
Representative ServicesCloudflare Images, Vercelimgix, CloudinarySharp + CloudFrontAstro Image, next/image
Initial Setup ComplexityLowLowHighModerate
Image Processing FlexibilityBasic transformationsExtremely highCompletely flexibleWithin build configuration bounds
Runtime CostsIncluded in CDN pricingFrom $25–$79+/monthAWS usage fees (pay-as-you-go)Zero (processed at build time)
Estimated Monthly Cost (Small Scale)Free to $5$25〜$99$10〜$50Free
ScalabilityHighHighDepends on architectureDependent on build times
Dynamic Image GenerationPossiblePossiblePossibleNot possible (build time only)

How to choose the optimal pattern for SME websites

Deciding which pattern to choose comes down to three factors: website scale, update frequency, and internal technical capability.

Corporate and brand sites (under 100 images, updated a few times a month)Built-in SSG is best. Running costs are zero, and optimization finishes at build time. If you use Astro or Next.js, you can get started with no additional cost.

E-commerce and media sites (over 1,000 images, updated daily)Image transformation SaaS (imgix / Cloudinary) is a strong fit. Massive product catalogs and thumbnails can be dynamically generated and served, creating countless size variants via simple URL parameters.

Already using CloudflareBuilt-in CDN offers the least effort. Simply enabling Polish (automated image optimization) automatically converts existing images to WebP/AVIF.

Running on AWS infrastructure → The self-hosted option lets you add an image processing layer to existing CloudFront + S3 setups. However, considering build and maintenance labor, SaaS solutions often yield lower total costs.

For details on web production pricing, see our guide on Standard Costs for Website Development.


Five techniques to master during implementation

Once you select a pattern, here are five specific techniques to maximize impact in actual implementation.

1. Automatic format conversion to WebP / AVIF

As of 2026, AVIF browser support has reached approximately 95%, enabling file size reductions of around 41% compared to JPEG. WebP also delivers 20% to 30% savings over JPEG.

The recommended priority order is AVIF → WebP → JPEG. Configure tiered fallbacks using <source> elements inside a <picture> tag, or utilize automated CDN format negotiation based on the Accept header.

<picture>
  <source srcset="image.avif" type="image/avif">
  <source srcset="image.webp" type="image/webp">
  <img src="image.jpg" alt="説明テキスト" width="800" height="450">
</picture>

2. Responsive image srcset configuration

Serving a 1920px-wide desktop image on smartphones wastes valuable bandwidth. Use srcset and sizes attributes to serve properly sized images tailored to the device viewport width.

<img
  srcset="image-480w.webp 480w, image-800w.webp 800w, image-1200w.webp 1200w"
  sizes="(max-width: 600px) 480px, (max-width: 1024px) 800px, 1200px"
  src="image-800w.webp"
  alt="説明テキスト"
  width="1200"
  height="675"
>

With image transformation SaaS or built-in CDN solutions, multiple sizes can be generated automatically simply by specifying dimensions in URL parameters.

3. Properly differentiating lazy loading (loading="lazy")

While loading="lazy" is effective for below-the-fold images, it must never be used on above-the-fold images targeted for LCP. Applying lazy loading to LCP images causes the browser to delay fetching them, worsening LCP.

<!-- ファーストビューのヒーロー画像: eager(即時読み込み) -->
<img src="hero.webp" alt="メインビジュアル" loading="eager" fetchpriority="high">

<!-- ファーストビュー外の画像: lazy(遅延読み込み) -->
<img src="article-image.webp" alt="記事内画像" loading="lazy">

Adding fetchpriority="high" to the LCP image prompts the browser to prioritize fetching the resource, further improving LCP.

4. CLS mitigation using placeholders (LQIP / BlurHash)

Jank caused by layout shifts before images finish loading hurts your CLS (Cumulative Layout Shift) score. The following two countermeasures are effective:

  • Explicit width / height attributes: Allows the browser to reserve display space in advance, preventing layout shifts
  • LQIP (Low Quality Image Placeholder): Inlines an ultra-small (hundreds of bytes) blurred image placeholder and swaps in the actual image once loaded, improving perceived speed for users

5. Designing cache headers (Cache-Control / immutable)

Image files do not need to be re-downloaded unless the content changes. Setting proper cache headers dramatically improves load speeds for returning visitors.

Cache-Control: public, max-age=31536000, immutable
  • max-age=31536000: Enables caching for one year
  • immutable: Informs the browser that the resource will never change, bypassing conditional validation requests (304 responses) entirely

Including hashes or version numbers in image URLs allows new URLs to invalidate cache whenever images are updated (cache busting).


Measuring impact — 3 key metrics to track before and after

After implementing image optimization, measure improvement outcomes quantitatively. Here are the three metrics to watch:

MetricMeasurement toolTarget Goal
LCP(Largest Contentful Paint)PageSpeed Insights, Chrome DevToolsWithin 2.5 seconds
CLS(Cumulative Layout Shift)PageSpeed Insights, Web Vitals extension0.1 or less
Total transfer sizeChrome DevTools > Network tab40% to 60% reduction compared to pre-implementation

Measurement tips:

  • Always record baseline scores before making changes. Without a before-and-after comparison, impact cannot be validated
  • Prioritize field data (real user metrics) from PageSpeed Insights. Lab data (synthetic tests) fluctuates heavily due to environmental variables
  • Measure both mobile and desktop. Because mobile environments face tougher network conditions, optimization gains appear much more pronounced

Data indicates that switching to an image-optimizing CDN alone reduces image file sizes by 40% to 80%. For sites exceeding 10,000 monthly page views, reduced bandwidth and lower hosting costs represent significant benefits.


Conclusion — Image optimization is the website initiative with the "highest ROI"

CDN-driven image optimization involves relatively low technical complexity while delivering benefits across loading speeds, user experience, SEO, and infrastructure costs.

To summarize the key points:

  • Images make up 50% to 70% of page weight — Optimizing them drastically cuts overall transfer volume
  • Select the best fit among the four implementation patterns according to company scale, tech stack, and budget
  • Combine an AVIF-first format strategy with srcset, lazy loading, and caching best practices
  • Measure results before and after, aiming for LCP under 2.5 seconds and CLS under 0.1

If you want to speed up your website but do not know where to begin, or lack the staff to implement image optimization, reach out to GleamHub's website development services. We provide end-to-end support, from performance auditing to selecting and implementing the ideal architecture.

Share this articleXFacebook
Rui Teruya

Former corporate league baseball player and founder of an IT venture. Founded the company with the drive to ride the fast-moving waves of the world and deliver truly valuable services to society.

Turn this article's theme into your company's next step

Starting from what you want to achieve with your website.

We organize user goals, required features, and ongoing maintenance structures to determine the first steps in development and improvement.

  • Website objectives
  • Features and usability
  • Post-launch operations
Consult on web development and improvements

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles via email · Read the web production guide
Free download

Complete Guide to Web Production: Costs, Vendor Selection & Traffic Acquisition [2026 Edition]

We have compiled cost benchmarks, vendor selection criteria, and traffic acquisition strategies into a PDF.

The PDF and newsletter emails are currently in Japanese.

You will also be subscribed to our newsletter. You can unsubscribe at any time.