News:

Wondering if this will always be free?  See why free is better.

Main Menu

Proxy Handler for Images..

Started by tjbalon, December 13, 2017, 09:12:13 PM

Previous topic - Next topic

tjbalon

So I'm not too sure where to put this, this is a bit of a support request I suppose.

Why is it that the image proxy only proxies images which are non-ssl? To what I've seen on most websites, every image will go through the proxy, non-cached, take github camo for example.

Is there an easy way to extend the proxy to proxy EVERY image instead of just those that are non-SSL.

Thanks,
TJ

Arantor

Because there's no point in using your bandwidth for images that will show up.

GitHub etc have a fairly large stack of servers just for handling images so it goes faster. Unless you plan on building your own CDN, changing the proxy as you suggest will make your entire site slower.

tjbalon

Quote from: Arantor on December 14, 2017, 03:10:26 AM
Because there's no point in using your bandwidth for images that will show up.

GitHub etc have a fairly large stack of servers just for handling images so it goes faster. Unless you plan on building your own CDN, changing the proxy as you suggest will make your entire site slower.

Yeah I understand that for the most part, however we don't cache the images we simply just proxy them in-view. Is there an easy change to make it go for all images as of right now, or is that functionality difficult to achieve? I have not really gone through the proxy code, wouldn't imagine a temp change would be difficult. Considered writing a mod for it in the future, but I don't think it'd pass with that closing statement of the site being slower.

vbgamer45

There are five spots that you need to change to ache all just have to remove http/s checks in the code such as
Require code changes such as          

if (!empty($modSettings['force_ssl']) && $image_proxy_enabled && stripos($user_settings['avatar'], 'http://') !== false)
$user_settings['avatar'] = strtr($boardurl, array('http://' => 'https://')) . '/proxy.php?request=' . urlencode($user_settings['avatar']) . '&hash=' . md5($user_settings['avatar'] . $image_proxy_secret);



if (substr($data, 0, 8) != 'https://' && $image_proxy_enabled)
$data = $boardurl . '/proxy.php?request=' . urlencode($data) . '&hash=' . md5($data . $image_proxy_secret);

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

tjbalon

Quote from: vbgamer45 on December 15, 2017, 10:40:24 PM
There are five spots that you need to change to ache all just have to remove http/s checks in the code such as
Require code changes such as          

if (!empty($modSettings['force_ssl']) && $image_proxy_enabled && stripos($user_settings['avatar'], 'http://') !== false)
$user_settings['avatar'] = strtr($boardurl, array('http://' => 'https://')) . '/proxy.php?request=' . urlencode($user_settings['avatar']) . '&hash=' . md5($user_settings['avatar'] . $image_proxy_secret);



if (substr($data, 0, 8) != 'https://' && $image_proxy_enabled)
$data = $boardurl . '/proxy.php?request=' . urlencode($data) . '&hash=' . md5($data . $image_proxy_secret);


Thanks vbgamer, you rock dude :^)

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: