Resource icon

ImageProxy Host 0.3

No permission to download

Jim Boy

Well-known member
Jim Boy submitted a new resource:

ImageProxy Host - Allows caching of your proxied images

This simple add-on will append a string to the front of your proxy link when you are serving images from the XenForo Image Proxy service. That string would normally be a host such a caching service like cloudflare or cloudfront. This will freee up your web server from serving large amounts of image data.

Change the location by going to:

ACP->Options->Messages->Host for serving proxied images

Read more about this resource...
 

melbo

Well-known member
Interesting. So with your addon, are these now treated as real images that could be optimized/compressed as well?
 

kontrabass

Well-known member
Interesting idea, thanks for sharing! Testing it out now. Using our CDN url to take load off of apache and speed loading.
 

Jim Boy

Well-known member
I can only go by my own experience and so far it is working fine. The code is super simple so have a review if you feel inclined. I've only run this through cloudfront but I dont see why this wouldn't work on other cdns.
 

Kerby

Well-known member
I'm not sure about the purpose of this addon. Is this addon only useful when I have a CDN to move the image cache from localhost to CDN?
 

kontrabass

Well-known member
Happy to report that this is working great! With over 1 million proxied images, it's taken the CDN a while to get everything cached, so after 24 hours I'm just now starting to see a decrease in apache load.
 
Last edited:

m1ne

Well-known member
Happy to report that this is working great! With over 1 million proxied images, it's taken the CDN a while to get everything cached, so after 24 hours I'm just now starting to see a decrease in apache load.

What did you set for "Host for serving proxied images"?, not sure what to do for Cloudflare.
 

m1ne

Well-known member
So the url looks like this?

Code:
http://domain.com/domain.kxcdn.com/proxy.php?image=xxxxxx

If so, I guess I can enter something like "CF" and mine will become CF/proxy.php?image= then set a page rule in Cloudflare. Right @Jim Boy ?
 

rdn

Well-known member
What did you set for "Host for serving proxied images"?, not sure what to do for Cloudflare.
If you use Cloudflare you don't need this addon, just use Cloudflare Page Rule to force cache proxy images.
IG8VGtn.png
 

rdn

Well-known member
Oh I forgot about that. You sure the css.php rule works? I use BD Cache so they end in .css
Css.php file cache works better than having bdcache :).

No need for extra addon.
You can verify by either miss/hit cache header.
 

Jim Boy

Well-known member
If you use Cloudflare you don't need this addon, just use Cloudflare Page Rule to force cache proxy images.

If you are using cloudflare to serve your site, then this add-on is indeed redundant. This addon is only useful fir sites that go direct to the webservers for primary html and use cdn's to serve static data.

I personally dont use cloudflare, but the principle is that you are effectively are creating a proxied version of your site on alternative url.
 

motowebmaster

Well-known member
Just installed, configured, and verified that it's working on a proxied image inserted last year.

However, I had to disable it afterward. Found a problem with an image in a user's signature. Instead of a small map of the us, one of the proxied images from the same thread was displaying instead. When I disabled the addon the issue was resolved.

I love this idea, would like to try it again.
 

Jim Boy

Well-known member
That sounds like it may have been an issue with your cdn. Did the url of the proxied image match what it was when the ad-on was off?
 

Nuno

Well-known member
Hi

I tested this and it's rewriting links too. This should only prepend the url if we're proxying images.

Something line this will do it:

Code:
                if ($proxyType == 'image')
                {
                        return $proxy.'proxy.php?' . $proxyType . '=' . urlencode($url) . '&hash=' . $hash;
                } else {
                        return 'proxy.php?' . $proxyType . '=' . urlencode($url) . '&hash=' . $hash;
                }
 
Top