Post by ASG » Thu Jun 29, 2017 5:46 pm

I have wasted the last 1 day to find if an actual solution for this problem exists. There is nothing clear enough which states that there is a solution for OC2 onwards, and nothing actually works.

Is this important?

Yes. Google thinks so, other Pagespeed tests think so.

Why? Because, browsers have a property known as "max connections per server", so images on a subdomain get loaded concurrently with html, js and css in modern browsers and not get queued up.

https://stackoverflow.com/questions/985 ... -a-browser

Ideally when coming from 1.5.x to 2.x there should have been an additional option of adding JS, CSS resources on a separate sub-domain, (since 1.5.x. to 2.x was an upgrade), on the contrary the feature to host even images on the sub-domain was made difficult or even next to impossible.

So, is there anyone kind enough here to tell me how to do host images for OC-2.3.0.2 on a sub-domain, since what worked for 1.5.x is not working in 2.3.0.2.

P.S.: IP_cam: Please do not point me to this thread, it does not work for 2.3.0.2:
http://devs.mx/topic/388-increase-page- ... in/?p=2108
Last edited by ASG on Thu Jun 29, 2017 6:05 pm, edited 1 time in total.

ASG
Active Member

Posts

Joined
Tue Sep 30, 2014 11:03 pm

Post by paulfeakins » Thu Jun 29, 2017 6:00 pm

Maybe I've misunderstood but could you combine some of the resources in to 1 file?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by ASG » Thu Jun 29, 2017 6:08 pm

paulfeakins wrote:
Thu Jun 29, 2017 6:00 pm
Maybe I've misunderstood but could you combine some of the resources in to 1 file?
I am not referring to JS/CSS resources which can be minified into a single file.

The problem I am looking a solution for is "How to host images on a sub-domain in Opencart 2.3.0.2", since the config.php files in OC do not have the line where you define HTTP_IMAGE or HTTPS_IMAGE, and even if you add it, OC doesn't recognise that particular line.

ASG
Active Member

Posts

Joined
Tue Sep 30, 2014 11:03 pm

Post by IP_CAM » Thu Jun 29, 2017 6:46 pm

I was not going to :laugh:
but this Mod worked swell in some OC v.2.1.0.2, I tested some time ago,
so, it should, at least technically, also function in your version !
Good Luck! ;)
Ernie
---
Extension removed, since no reaction has taken place...
Last edited by IP_CAM on Mon Jul 03, 2017 6:59 am, edited 1 time in total.

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by schiggi » Thu Jun 29, 2017 8:40 pm

Maybe it is worth mentioning (for people, who found this thread via search), that with recent implementation of HTTP/2 for https (with letsencrypt no excuses to not move to https) it is no longer needed to do domain sharding to overcome max connections limitation in older browsers.

For more information read http://searchengineland.com/everyone-mo ... tp2-236716 , https://blog.stackpath.com/http2-and-cdn , https://ahmadawais.com/wordpress-and-ht ... d-to-know/ and https://blog.stackpath.com/glossary/domain-sharding/

This is only true, if you have a modern server with HTTP/2 support, a modern browser and serve your content via https.

New member

Posts

Joined
Tue May 13, 2014 4:23 am

Post by IP_CAM » Thu Jun 29, 2017 11:02 pm

well, he wants to use this Subdomain Image function, to speed up overall performance, I assume.
And this will work, regardless of max connection limitations, https, or some modern techniques. Just
to mention this!
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by stavrosa » Fri Sep 22, 2017 2:07 am

ASG wrote:
Thu Jun 29, 2017 5:46 pm
So, is there anyone kind enough here to tell me how to do host images for OC-2.3.0.2 on a sub-domain, since what worked for 1.5.x is not working in 2.3.0.2.

P.S.: IP_cam: Please do not point me to this thread, it does not work for 2.3.0.2:
http://devs.mx/topic/388-increase-page- ... in/?p=2108
Did you find something about it?
We are in the same page, i tried everything related on internet but it didnt worked on 2.3.0.2
Thanks

Newbie

Posts

Joined
Wed Sep 23, 2015 8:08 pm

Post by IP_CAM » Fri Sep 22, 2017 9:47 am

Well, the Chief in OC-Command changed the $new_image to $image_new, to make it
a little harder on us, but he still ignored to add the Image Size Tags, missing since OC v.0.01 ! :laugh:
---
But you could try one of the Extensions below, depending on, if you use VqMod or OcMod,
after adding the HTTP/S image links into your ROOT config.php file, like:

Code: Select all

define('HTTP_SERVER', 'http://www.yourshop/shop/');
define('HTTP_IMAGE', 'http://yourshop/shop/image/');
// HTTPS
define('HTTPS_SERVER', 'http://www.yourshop/shop/');
define('HTTPS_IMAGE', 'http://yourshop/shop/image/');
or then, if you use https:

Code: Select all

define('HTTP_SERVER', 'https://www.yourshop/shop/');
define('HTTP_IMAGE', 'https://yourshop/shop/image/');
// HTTPS
define('HTTPS_SERVER', 'https://www.yourshop/shop/');
define('HTTPS_IMAGE', 'https://yourshop/shop/image/');
or then in REVERSE, if you use http(s):// YOURSHOP/ as regular Shop URL
instead of http(s):// WWW.YOURSHOP/
And this also depends on, if you use a /SHOP/ Subdirectory or not!
---
I cannot test anything, in case, it will not function!
Good Luck ! ;)
Ernie
PS: The Second Extension Routine is only of MINOR Importance:
<file name="catalog/model/extension/ ......
and could eventually be removed in full, at least, to test the 'important Matter'
if some problem would occurre, as the Mod comes as written! ::)
---
VqMod Version:
---

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
<id><![CDATA[HTTP_IMAGE + HTTPS_IMAGE Links and Sizes]]></id>
<version><![CDATA[OS v.2.3.x]]></version>
<vqmver><![CDATA[2.6.1]]></vqmver>
<author><![CDATA[Ernie - IP_CAM]]></author>

<file name="catalog/model/tool/image.php">
<operation error="log">
<search position="replace"><![CDATA[eturn $this->config->get('config_ssl') . 'image/' . $image_new;]]></search>
<add><![CDATA[return HTTPS_IMAGE . $image_new . '" width="' . $width . '" height="' . $height;]]></add>
</operation>            
<operation error="log">
<search position="replace"><![CDATA[return $this->config->get('config_url') . 'image/' . $image_new;]]></search>
<add><![CDATA[return HTTP_IMAGE . $image_new . '" width="' . $width . '" height="' . $height;]]></add>
</operation>                  
</file>

<file name="catalog/model/extension/openbay/ebay_order.php,catalog/model/extension/openbay/ebay_product.php,catalog/model/checkout/order.php,catalog/controller/extension/payment/pilibaba.php,catalog/controller/extension/payment/skrill.php,catalog/controller/extension/payment/skrill.php,catalog/controller/extension/total/voucher.php">
<operation error="log">
<search position="replace"><![CDATA[$this->config->get('config_url') . 'image/']]></search>
<add><![CDATA[HTTP_IMAGE]]></add>
</operation>
<operation error="log">
<search position="replace"><![CDATA[$this->config->get('config_ssl') . 'image/']]></search>
<add><![CDATA[HTTPS_IMAGE]]></add>
</operation>
</file>

</modification>
---
OcMOD Version:
---

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<modification>
<name><![CDATA[HTTP_IMAGE + HTTPS_IMAGE Links and Sizes]]></name>
<version><![CDATA[OS v.2.3.x]]></version>
<code><![CDATA[http_image_links_and_sizes]]></code>
<author><![CDATA[Ernie - IP_CAM]]></author>

<file path="catalog/model/tool/image.php">
<operation error="log">
<search><![CDATA[eturn $this->config->get('config_ssl') . 'image/' . $image_new;]]></search>
<add position="replace"><![CDATA[return HTTPS_IMAGE . $image_new . '" width="' . $width . '" height="' . $height;]]></add>
</operation>            
<operation>
<search><![CDATA[return $this->config->get('config_url') . 'image/' . $image_new;]]></search>
<add position="replace"><![CDATA[return HTTP_IMAGE . $image_new . '" width="' . $width . '" height="' . $height;]]></add>
</operation>                  
</file>

<file path="catalog/model/extension/openbay/ebay_order.php,catalog/model/extension/openbay/ebay_product.php,catalog/model/checkout/order.php,catalog/controller/extension/payment/pilibaba.php,catalog/controller/extension/payment/skrill.php,catalog/controller/extension/payment/skrill.php,catalog/controller/extension/total/voucher.php">
<operation error="log">
<search><![CDATA[$this->config->get('config_url') . 'image/']]></search>
<add position="replace"><![CDATA[HTTP_IMAGE]]></add>
</operation>
<operation>
<search><![CDATA[$this->config->get('config_ssl') . 'image/']]></search>
<add position="replace"><![CDATA[HTTPS_IMAGE]]></add>
</operation>
</file>

</modification>

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 78 guests