astro image optimization

Use Skymage for image-heavy Astro pages without moving your media

Keep CMS, product, and uploaded images on their current public origin. Let Astro templates request Skymage URLs for exact dimensions, crops, WebP or AVIF output, and cached delivery.


---
const skymage = (src, params = {}) => {
  const query = new URLSearchParams(params).toString();

  return `https://demo.skymage.net/v1/${src}${query ? `?${query}` : ''}`;
};

const hero = skymage('assets.example.com/blog/hero.jpg', {
  w: 1280,
  f: 'avif',
  q: 84,
});
---

Optimized Astro page hero
where it fits

Start with Astro routes where image slots repeat

A useful Astro image optimization test starts with one page type, one source pattern, and enough repeated images to make bandwidth and Core Web Vitals movement visible.

Content collections

Serve article covers, author photos, and related-post cards from the same CMS originals.

Static storefronts

Generate product-card, collection, and hero variants without a build-time image queue.

Marketing pages

Test landing-page heroes, case-study images, and social proof thumbnails before changing every template.

template rollout

Keep image variants close to the Astro template

Use a small helper to build Skymage URLs from the CMS or product image paths your Astro route already renders. Test one component or collection template before changing the whole site.


---
const cardImage = skymage(post.data.coverImage, {
  w: 480,
  h: 320,
  fit: 'cover',
  f: 'webp',
  q: 82,
});
---

{post.data.title}

{post.data.title}

evaluation path

A practical Astro image CDN test answers four questions

Origin fit

Can Skymage transform the public image paths your Astro site already renders?

Template sizes

Can each template request the exact dimensions it displays on desktop and mobile?

Format output

Can content routes ship WebP or AVIF without changing CMS or upload workflows?

Rollout risk

Can one route prove the pattern before site-wide image changes?

free check

Get an Astro image route audit

Send one public Astro route. Skymage will identify the repeated image slot to test first, the URL parameters to try, and whether the current origin fits a low-risk rollout.

deploy

Start shipping lighter images.

Create a Skymage CDN URL, prepend it to your existing image URLs, and let the edge handle optimization, transforms, and delivery.

No credit card required. 14-day free trial.

Test one image-heavy page first. Get a free audit or start a trial with the same tracked source.