Skip to main content
Use this page when you fetch Cevoid image URLs and want to render them efficiently in a storefront. If you are looking for gallery or card implementation behavior, use Analytics Overview or the API Reference instead.

When to use this

Use image optimization when:
  • you fetch raw Cevoid image URLs from the API
  • you render those images in a custom storefront UI
  • you want smaller responsive images instead of the original full-size asset
Cevoid image URLs return the original image by default. Add the class query parameter when you want a pre-optimized size from the CDN.

Quickstart

  1. Fetch or receive the original Cevoid image URL.
  2. Add ?class=<size> to request an optimized width.
  3. Use the optimized URL in your storefront markup.
  4. Add srcset only when you need responsive behavior across breakpoints.
Example:

Available Image Classes

The Cevoid CDN provides several pre-optimized image sizes:

Example: transform an API image URL

When you fetch posts from the API, you’ll receive image URLs like this:
Transform the URL by adding the class parameter:
Result:

Performance guidance

Choose the Right Size

Select the image class that best matches your display requirements. Using unnecessarily large images wastes bandwidth and slows loading times.

Responsive Images

Use different image classes for different screen sizes:

Pick the nearest useful class

Best Practices

1. Match Image Size to Container

Always choose an image class that matches or slightly exceeds your container’s display size:

2. Consider Display Density

For high-density displays (Retina, etc.), use an image class that’s 2x your container size:

3. Lazy Loading

Combine image optimization with lazy loading for maximum performance:

4. Fallback Strategy

Always have a fallback for when optimized images fail to load:
The Cevoid CDN automatically handles caching and global distribution of optimized images, ensuring fast loading times for users worldwide.

5. Preloading Critical Images

For above-the-fold images, consider preloading:
Don’t preload too many images as this can actually slow down initial page load. Only preload the most critical, above-the-fold images.