Krunal
Krunal

Reputation: 3277

Challenges in loading images from CDN on multiple host name for e-Commerce site built on Nopcommerce

I am working on a ecommerce site built on the top of Nop Commerce 2.3. We want to use CDN for loading all static contents including its images, but not sure how to do this with NopCommerce.

Nopcommerce is set to save binary of images in db at the time of inserting product, and then it generates thumb or re-sized / optimized images at the run time as and when required and stored them in the content folder of the same application for retrieving on page during load time.

Now, suppose on some page, lets say, Home Page, we have 70 product images. I want to distribute it across four host name, so each host name will serve 17/18 images.

This is definitely to save some time in image loading.

Now the Question is:

How to do it in best way in NopCommerce?

The challenges are:

  1. Changing in nop commerce code to load images from CDN instead of its application\content folder. This is not an issue and is fine to manage.

  2. To implement this correctly we might need some mechanism that checks for image on CDN if it doesn't exist, then we might need to transfer the image from content folder to appropriate folder at CDN maybe ? (suggest), and if it doesn't exist in content folder, then need to generate suitable image first and then transfer it.

I'm concerned about this 2nd challenge, and wants to understand the best approach to do this. Moreover, how to do this... specifically check if image exists in CDN or not?

Not very much sure, how to do this? And is it okay or do you suggest something else?

Upvotes: 4

Views: 707

Answers (1)

Softlion
Softlion

Reputation: 12615

If you use the OVH CDN, you simply point your dns to the CDN dns, add the static file's extensions to the CDN configuration, and let it work for you. All other extensions will pass through. No code to change.

Upvotes: 2

Related Questions