Developer forum

Forum » CMS - Standard features » CDN images and Image resize

CDN images and Image resize

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I often see situations where we need to store images outside of the server where the solution is hosted. Usually, this means a CDN of some sort.

I was wondering if anybody managed to master a setup where the images would be stored on a CDN but would still be able to use the image resize capabilities of Dynamicweb.

Any suggestions or pointers would be highly appreciated.

Thank you,

Adrian


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Adrian

You have 2 options depending on the CDN you use.

Option 1

Hosting the images with Dynamicweb using GetImage to resize them - and the prefix them with a CDN hostname so it will be cdn.some-service.com/admin/.../GetImage.ashx?... - some CDNs can work in this way where they act as a proxy. I.e. AWS Cloudfront can do this.

Option 2

You sync the files in Dynamicweb with a CDN store and use their image resizer, i.e. <img src="/cdn-cgi/image/width=80,quality=75/uploads/avatar1.jpg" /> This is how i.e. Cloudflare does it.

BR Nicolai

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Honestly, I don't know which version is better.

I am trying to optimize the space used on the server for different instances of the solution (dev, staging, UAT, production). This means that I would, ideally, store the absolute URL in EcomDetails instead of the relative URL (the way it normally is right now).

I am afraid that using the CDN resizer will only limit my options for resizing and rendering the images, not to mention that I would have to change all templates that have anything to do with images. This is why Option 1 is probably better. But this seems to require some configuration in Cloudflare to make it act as a proxy, right?

Thank you,

Adrian

 

You must be logged in to post in the forum