imgrender

Load images

How to reference and load images in imgrender

Remote images

imgrender can load remote images with the img tag and the CSS properties background-image and mask-image.

Supported image formats: jpeg, png, webp, and svg.

For rendering performance, meet these requirements

  1. Keep image files as small as possible. The maximum size is 10 MB. Files larger than 10 MB fail to load.

  2. The image URL must be reachable on the public internet. If the service hosting your images requires authentication (for example, a private object-storage bucket), the image URL must include the authentication parameters.

  3. The image URL must load quickly over the public internet.

<img src="https://www.imgrender.com/example.png">
<div
  style="background-image: url('https://www.imgrender.com/example.png')"
>
  ...
</div>
<div
  style="mask-image: url('https://www.imgrender.com/example.png')"
>
  ...
</div>

Caching

To improve rendering performance, imgrender caches images with the image URL as the key. When an image is loaded, a cache hit is used first and the image is not downloaded from the network again.

How to invalidate the cache

If imgrender has already cached the image for a URL, and the image content changes while the URL stays the same, imgrender still uses the cached image.

To avoid that, add or change a query parameter on the URL, as shown below.

Old URL:

https://www.imgrender.com/images/example.png

New URL:

https://www.imgrender.com/images/example.png?v=1

On this page