0

I'm in the business of marketing product from other companies, those companies submit their product to me and I market it through my site. Along with the product comes images and we are talking millions of them that change daily.

I started heading down the path of proxying my partner sites image urls rather than downloading, processing and storing every images on my end. Although this works, it doubles the bandwidth for me, so I'm looking for a better approach.

One of the main issues I face is my site is https and some of my partner sites are not which results in a certificate error if I attempt to host them directly.

I happened to see an example where someone was doing something like this.

https://www.example.com/demo/image?src=http://www.partnerdomain.com/images/example_image.png

So I did some research on it and didn't turn up much of anything on it.

So my question, is this a valid way of doing it, or is it just someones way of setting up their proxy? If it is a valid way, would this address my bandwidth / ssl concerns?

Code Junkie
  • 7,272
  • 25
  • 72
  • 136
  • The example is a proxy, the `image` script presumably downloads the url its passed on the server and spits it back thus ensuring HTTPS is used. The only way to optimise this is some kind of cache that only re-requests the image from its true source based on some set of conditions. See http://stackoverflow.com/a/3042738/246342 – Alex K. Feb 26 '15 at 14:18
  • Perhaps you can solve your protocol problem with `src="//partnerdomain.com/images/image.png"` which will attempt to load https if the page is https and http when the page is http – mplungjan Feb 26 '15 at 14:22
  • @AlexK So it sounds as if I should just continue to proxy the image with proxypass and avoid the url parameter for security reasons. I'll have to look into caching images to disk. I'm assuming this would somehow be done in the proxy configuration on the server? – Code Junkie Feb 26 '15 at 14:30

0 Answers0