Service Endpoint

https://edge.sandcage.com/<YOUR REAL-TIME PROCESSING ENDPOINT KEY>/0.2/fetch


Common Use Cases

The most common use case of the "fetch" service is to deliver from a CDN edge an image that does not require any transformations (e.g. resizing, cropping, etc).


Request Parameters

url*
requiredThe relative or absolute URL path of the source image.
To mask the absolute path of a given source file an origin mapping can be assigned to the Realtime API Key.
compress
optionalA boolean representation of whether or not the resulting image should be compressed.
Available options:
  • true
  • false

Default is false.
format
optionalWhether or not the file format of the resulting image should be converted to one that will produce a file with smaller file size. The returned image file format will depend on the support of the client software (e.g. browser). If omitted or set to false, then the returned image file format will be the same as the source image.
Available options:
  • auto
  • false

Default is false.
progressive
optionalA boolean representation of whether or not the file is encoded in a format that allows for progressively higher detail to be decoded prior to the complete image being delivered. Some browser limitation apply (see here). If "compress" is omitted or set to "false" it will be overrided and set to "true".
Only available for JPEGs.
Available options:
  • true
  • false

Default is false.
optimize
optionalA boolean representation of whether the engine will attempt to optimize the Huffman coding tables. If "compress" is omitted or set to "false" it will be overrided and set to "true".
Only available for JPEGs.
Available options:
  • true
  • false

Default is false.

Simple Fetch Example Request

This request will simply fetch the source image, cache in and deliver it from the nearest CDN edge. Consecutive requests from the same geographic region will resulting in a much faster delivery.

https://edge.sandcage.com/18e102bea84860764a07dca77adbf145157751b7/0.2/fetch?url=p%2Fa%2Fimg%2Fothers%2Fbefore.jpg

Result

Original ImageOriginal
Modified ImageModified

Fetch with Auto-Format Enabled Example Request

This request will fetch the source image and choose the most suitable file format.

https://edge.sandcage.com/18e102bea84860764a07dca77adbf145157751b7/0.2/fetch?url=p%2Fa%2Fimg%2Fothers%2Fbefore.jpg&format=auto

Result

Original ImageOriginal
Modified ImageModified

Fetch with Compression Enabled Example Request

This request will fetch the source image and compress the image.

https://edge.sandcage.com/18e102bea84860764a07dca77adbf145157751b7/0.2/fetch?url=p%2Fa%2Fimg%2Fothers%2Fbefore.jpg&compress=true

Result

Original ImageOriginal
Modified ImageModified

Fetch with Compression and Auto-Format Enabled Example Request

This request will fetch the source image, compress the image and choose the most suitable file format.

https://edge.sandcage.com/18e102bea84860764a07dca77adbf145157751b7/0.2/fetch?url=p%2Fa%2Fimg%2Fothers%2Fbefore.jpg&format=auto&compress=true

Result

Original ImageOriginal
Modified ImageModified

Give it a try

You can adjust the options below to produce the respective parameters and see the resulting image.

https://edge.sandcage.com/18e102bea84860764a07dca77adbf145157751b7/0.2/fetch?url=p%2Fa%2Fimg%2Fothers%2Fbefore.jpg

Result


Still Have Questions?

We're always happy to help with code and integrations. Talk to us!