Monday, April 6, 2026 1:11:15 AM

How are URLs created/stored and best way of storing images

9 years ago
#164 Quote
Hey Guys,

So we are trying to make our DB more lean and wanted to take advantage of using CDN with Azure. This part was successful and we were able to configure everything. I did however notice that images are still stored in the DB. Which led to a few questions I could not find answered anywhere? Hopefully anyone can help.

- Where are the cdn urls stored for a product image?
- How are the urls created?
- If I'm storing the images in the DB, can I delete the binary image record from the products table?
- If I'm storing the images in the files system, can I delete the image locally?

Thanks!!
0
9 years ago
#165 Quote
Hello,

- Where are the cdn urls stored for a product image?
In case of nopAccelerate CDN plugin we do not store CDN URLs of products. Instead we just create picture URL as per the CDN url you have configured in CDN plugin by extending picture service which is responsible for creating image urls.

- How are the urls created?
Please look at the GetPictureURL method of nopCommerce in PictureService. You will get better idea.

- If I'm storing the images in the DB, can I delete the binary image record from the products table?
- If I'm storing the images in the files system, can I delete the image locally?
If you store images in DB you can not delete records of binary from Picture table. And same in case if you store them on file system you can not delete them from your system. Otherwise you will lost all your product images. CDN is used to distribute load from your server as well as to serve resources faster from CDN network nodes that are closer to visitor's location. But CDN still need to have pictures which are fetched from origin url, which in turn is going to be your store url. And to generate picture here, you need to keep images either in DB or on File Systems.
0