Image & Video APIs

Why am I getting a 404 (or other 40x errors) for one transformation URL while other transformed versions of that asset work?

Last updated: Mar-12-2026

Why this happens

When a transformed asset URL returns a 40x error (such as 404), that error is cached at the CDN. If the underlying issue isn't resolved, repeated requests to the same URL increase the cache time exponentially:

  • First error: Cached for 1 minute
  • Subsequent errors: Cache time doubles (2 minutes, 4 minutes, 8 minutes, etc.)
  • Maximum cache: 24 hours

For example, if you request a transformed version of an asset before uploading it or before an expected public ID rename, the 404 error gets cached. Even after uploading/renaming the asset, that specific transformation URL continues returning the cached error until the cache expires.

Tip
Test if you're getting a cached error. Add a no-impact transformation like \a_0\ to the failing transformation URL. If this works while the original transformation URL fails, you're experiencing a cached error.

Resolution

Prevent the issue

Upload the original asset to your Cloudinary account (or rename the public ID of the original asset) before requesting any transformed versions. This ensures transformation URLs won't encounter a 404 error due to a missing original asset.

Work around cached errors

If you're already experiencing cached errors, try these approaches:

  • Add version numbers: Include the asset's version number in the URL after upload. Learn about asset versions.
  • Use different transformations: Apply different transformation parameters or reverse the order of transformations to bypass the cached URL.
  • Use placeholder images: Configure a default placeholder image to display when 404 errors occur. Learn about default image placeholders.
  • Invalidate the cached asset: Use the invalidate parameter when programmatically renaming an asset, or run the invalidation on any existing asset using Explicit to immediately clear the cached asset and all its derived versions. This method is useful to quickly solve the 404 error without waiting for the cache to expire or having to modify code that might already be in production.
    Tip
    You can use the Asset Management MCP server, Cloudinary Postman collection or the CLI, to quickly perform an explicit invalidation on an asset.

✔️ Feedback sent!

Rate this page:

one star two stars three stars four stars five stars