cancel
Showing results for 
Search instead for 
Did you mean: 

How to serve images from a remote URL?

How to serve images from a remote URL?

Curious if anyone has had experience serving product images from an external URL? And to clarify, I don't mean import from an external URL.

 

We have a situation where we're getting product data via a feed, and part of the agreement requires that images aren't downloaded or hosted, but served from a designated URL owned by the data provider. Ideally, we'd like to be able to serve multiple images and retain the native image gallery. 

 

Any recommendations of where to start?

 

6 REPLIES 6

Re: How to serve images from a remote URL?

Hi @jwpeters,

 

Correct me if I'm wrong but you want to use some similiar to a CDN for your images.

All the catalog images will be served from that remote URL or you'll use some images from remote source and others from your server?

Re: How to serve images from a remote URL?

Hi @Damian Culotta!

 

Yes, I suppose it's similar to using a CDN, except we never have permission to download the images.

 

We'll need to serve some images from our server, but most will be served from a remote source.

Re: How to serve images from a remote URL?

Hi @jwpeters,

 

Without knowing how you can connect the store with the remote server I'm out of ideas.

I understand what you need to implement.

Isn't easier to use a regular CDN? Is that something you can use instead this custom implementation?

 

Re: How to serve images from a remote URL?

Yeah @Damian Culotta, this is a strange one for sure.

 

We won't actually connect directly to the vendor site, but rather use the image path that's on their server. We're not permitted to download the images, because the product feed is a service that is paid for. But, are you thinking we could use a CDN to serve those remote images as well as the ones we'd upload? I'd never thought of that if that's what you're suggesting.

 

Our current plan is to create a new attribute for the image filenames, and then conditionally output those in the theme if there are no product image values.

Re: How to serve images from a remote URL?

Hi @jwpeters,

 

Well... honestly... I'm not sure what I was thinking.

The only similar scenario I can remember was with a module I wrote: https://github.com/barbanet/magento-dc-thumbr/blob/master/app/code/community/Dc/Thumbr/Helper/Image....

 

That service is a CDN with some extras (I'm not selling anything).

That CDN recieves the original URL first time and then create a copy you can use for some time.

So, it was on Magento 1, I made that override and in that way, if the Image was on local, I send the image to the CDN and then use the CDN url.

If CDN url doesn't work, I use the local URL.

 

I guess the idea should help you to imagine an approach or to validate your current idea.
Let me know if I'm not clear.

Re: How to serve images from a remote URL?

Hi @jwpeters ,

 

Could you help us with the solution as I am facing issues with the same scenario.