Post by hendrachristian » Tue Jan 19, 2016 7:41 pm

There are many articles regarding hosting images in subdomain for performance gain like:
- http://www.inmotionhosting.com/support/ ... n-opencart
- viewtopic.php?f=138&t=40573
- viewtopic.php?f=181&t=148756

but they are for OC prior to 1.5.6. I need a solution that works with latest OC 2.1.0.2.

Does anyone know how to do it? All the articles/forum posts I found is not applicable to OC version 2.

------------------------------------
Hendra
https://www.primanada.com


User avatar
New member

Posts

Joined
Mon Mar 23, 2015 4:34 pm
Location - Jakarta, Indonesia

Post by IP_CAM » Tue Jan 19, 2016 8:27 pm

my Posting is NOT prior to v.1.5.6.x, and it works exactly the same way in OC-2:
Sample Site V-2:
http://www.jti.li/shop/

Ernie

I'm rarely active at the OC Forum lately. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'100+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

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

Post by hendrachristian » Wed Jan 20, 2016 4:14 pm

IP_CAM wrote:my Posting is NOT prior to v.1.5.6.x, and it works exactly the same way in OC-2:
Sample Site V-2:
http://www.jti.li/shop/

Ernie
I'm guessing you mean this link: http://devs.mx/topic/388-increase-page- ... in/?p=2108 ?
I've had a look and it is for 1.5.6.*. I understand the concept of why it's good to load image from subdomain. I still can't find the implementation for OC 2.1.0.2 (or OC 2 basically). Can you please point me to the more specific post?

------------------------------------
Hendra
https://www.primanada.com


User avatar
New member

Posts

Joined
Mon Mar 23, 2015 4:34 pm
Location - Jakarta, Indonesia

Post by afssac » Wed Jan 20, 2016 4:23 pm

I think , it will be better if we make image uploader . I manage the website
http://www.afssac.edu.sa/home/
and i'm thinking if i make subdomain containg uploader for images . so , if anyone has advice for me regarding the image uploader in subdomain . does it affect the performance of the main website
http://www.afssac.edu.sa/home/

Newbie

Posts

Joined
Wed Jan 20, 2016 4:17 pm

Post by IP_CAM » Wed Jan 20, 2016 8:46 pm

did you already check this?
Cookieless HTTP Domain Routing

http://www.opencart.com/index.php?route ... n_id=23506

Ernie
openshop.li/shop/

I'm rarely active at the OC Forum lately. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'100+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

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

Post by hendrachristian » Sun Jan 24, 2016 7:24 pm

Image subdomain issue has been solved.

Apparently the template I used (Journal 2) already have the implementation ready (although not as I initially imagined it should be: https://images.primanada.com is pointing to https://www.primanada.com folder instead of https://www.primanada.com/image/ folder making all images to have the slightly redundant "image" word (https://images.primanada.com/image/cata ... a-logo.png for example)

No wonder when I tried to edit catalog/model/tools/image.php it didn't work because journal theme already modify the same file so the one loaded was from /system/storage/modification/.

The subdomain image does improve the site speed (as tested via GTMetrix), but only slightly. I have reduced image filesize, etc but the site (https://www.primanada.com) is still slower than I expect it to be. Not sure why.

------------------------------------
Hendra
https://www.primanada.com


User avatar
New member

Posts

Joined
Mon Mar 23, 2015 4:34 pm
Location - Jakarta, Indonesia

Post by IP_CAM » Mon Jan 25, 2016 1:37 pm

Correct, it even killed my Browser, trying to load your Site aling with other Browser-Windows opened, and I have not even Scripting Activated for your Site, bummer, bummer.... :choke: In addition, your image Subdomain is not cookie-free either, so, it does not really make much sense, to even use one.

10.6 Seconds, a simple 16 Requests, to load a 178 KBytes big Page, means, back to the Drawing-Board, you won't make it, like this, GTMetrix is not even able, to read your Stylesheet, and so presents a 95 Result, just, because it cannot not test test-load anything coreectly, this way. :o

Good Luck ! ;)
Ernie

Attachments

testresults.jpg

Test Results - testresults.jpg (96.69 KiB) Viewed 1457 times


I'm rarely active at the OC Forum lately. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'100+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

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

Post by hendrachristian » Mon Jan 25, 2016 2:21 pm

IP_CAM wrote:Correct, it even killed my Browser, trying to load your Site aling with other Browser-Windows opened, and I have not even Scripting Activated for your Site, bummer, bummer.... :choke: In addition, your image Subdomain is not cookie-free either, so, it does not really make much sense, to even use one.

10.6 Seconds, a simple 16 Requests, to load a 178 KBytes big Page, means, back to the Drawing-Board, you won't make it, like this, GTMetrix is not even able, to read your Stylesheet, and so presents a 95 Result, just, because it cannot not test test-load anything coreectly, this way. :o

Good Luck ! ;)
Ernie
Oh that is a different problem entirely. I'm having a weird problem just this past few days. The site open alright in Chrome, but in Firefox it's like what you see there. There's an error message regarding HPKP (Public Key Pinning) in Firefox Developer Tools. But I'm not sure if that's what causing the issue. The problem didn't appear the week before. It was alright to open in Firefox, Chrome, etc.

[EDIT: Found the issue to be CloudFlare. So https://images.primanada.com was set to bypass CF, now it's set to use CF and it works in Firefox, GTMetrix results also correct now.]

Attachments

gtmetrix-categorypage-primanada.jpg

GTMetrix - Category Page - Primanada - gtmetrix-categorypage-primanada.jpg (149.2 KiB) Viewed 1455 times

gtmetrix-homepage-primanada.jpg

GTMetrix - Home Page - Primanada - gtmetrix-homepage-primanada.jpg (140.14 KiB) Viewed 1455 times


------------------------------------
Hendra
https://www.primanada.com


User avatar
New member

Posts

Joined
Mon Mar 23, 2015 4:34 pm
Location - Jakarta, Indonesia

Post by IP_CAM » Tue Jan 26, 2016 3:03 am

You seem to use the lazy_load_images Extension, just be carefull, I also run into some problems because of this, and NO PERFORMANCE TESTER Site can handle this kind of stuff, thereby producing incorrectly Test-Results.
Ernie

I'm rarely active at the OC Forum lately. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'100+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

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

Post by hrm143 » Thu Oct 13, 2016 2:15 am

hendrachristian wrote:Image subdomain issue has been solved.

Apparently the template I used (Journal 2) already have the implementation ready (although not as I initially imagined it should be: https://images.primanada.com is pointing to https://www.primanada.com folder instead of https://www.primanada.com/image/ folder making all images to have the slightly redundant "image" word (https://images.primanada.com/image/cata ... a-logo.png for example)

No wonder when I tried to edit catalog/model/tools/image.php it didn't work because journal theme already modify the same file so the one loaded was from /system/storage/modification/.

The subdomain image does improve the site speed (as tested via GTMetrix), but only slightly. I have reduced image filesize, etc but the site (https://www.primanada.com) is still slower than I expect it to be. Not sure why.
hi, can you guide me how did you set up image submain in your store? i want to implement with my OC2.2.

Which are the files you modified..i would greatly appreciate your pointer on this. Thanks in advance

Newbie

Posts

Joined
Sun Jun 01, 2014 3:16 am

Post by IP_CAM » Thu Oct 13, 2016 9:42 am

you could try this VqMod, I created, a while ago, it also add's image with/height tags as well.
But FIRST read the readme-files, I won't repeat me on this, if it won't work ! ;)
Good Luck
Ernie

http://www.openshop.li/downloads/image_sub_domain.zip

I'm rarely active at the OC Forum lately. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'100+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

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

Post by jazibshaikh » Mon Nov 07, 2016 3:09 pm

@IP_CAM I knw you won't repeat yourself on it.
I have carefully read your docs and one question.
can we use image.mysite.com?

I have tried that but seems like images still using old URL?

www.mirrorcity.net.au

Your help will be great.

Newbie

Posts

Joined
Fri Nov 29, 2013 6:45 am

Post by IP_CAM » Mon Nov 07, 2016 7:51 pm

can we use image.mysite.com?
Sure you can ! BUT, you will have to configure this URL on your Server FIRST, in order to make it
'understand' and 'handle' such a URL.

But you could make it easier on you, by just using something like this:

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://www.gratis-anzeiger.com/shop/');
define('HTTP_IMAGE', 'http://gratis-anzeiger.com/shop/image/');
// HTTPS
define('HTTPS_SERVER', 'http://www.gratis-anzeiger.com/shop/');
define('HTTPS_IMAGE', 'http://gratis-anzeiger.com/shop/image/');
THEN, you don't have to configure anything, it will just function, because, it then uses the
URL without the WWW as Image Subdomain URL.

And to make sure, every HTTP://YOURSITE Site Call will be automatically changed to HTTP://WWW.YOURSITE,
just add this Code just BELOW the RewriteBase / Line in the .htaccess File, like shown here:
AFTER THIS:

Code: Select all

# SEO URL Settings
RewriteEngine On
RewriteBase /
ADD THIS:

Code: Select all

#Force (http host) non www to www (optional)
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

#Force (https host) non www to www (optional)
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
Good Luck ;)
Ernie
---
PS: This has nothing to do you your Problem, but the Forum PREVIEW Function does not work anymore, besides of the images, related with the Forum Software, since they seemengly played around with this place yesterday. :-\
And I get logged out just about every second attempt, to change existing content....

I'm rarely active at the OC Forum lately. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'100+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

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

Post by jazibshaikh » Mon Nov 07, 2016 9:44 pm

Thanks Ernie

That make sense and it should also work as cookieless domain. Although, I do have subdomain image.mirrorcity.net.au created in cPanel and redirecting to mirrorcity.net.au/image
How can we confirm after change whether images are bein loaded from subdomain or subfolder?
I tried to right click images to see link but couldn't spot the difference.
GTMatrix didn't show any change too.

Config files are edited in both root and admin to add HTTP_IMAGE (no other lines removed)
cPanel has been configured to handle subdomain
vQmod script has been loaded and modification page refreshed
Cache has been cleared

I will try use your way by omitting WWW if that works but... Am I missing something here?
I am usin OC2.0.3.1

Newbie

Posts

Joined
Fri Nov 29, 2013 6:45 am

Post by IP_CAM » Mon Nov 07, 2016 10:05 pm

I have no idea, BUT FIRST, you'll have to FIX your Image Links, and Image Titles, it's not allowed, by HTTP Spec's, to use and define Subdirectories, consisting of TWO SEPARATE Words, like Decorative Mirrors, or even use images, like the FP-054A RUSTY-275x300.jpg, in the first place:

http://www.mirrorcity.net.au/image/cach ... 75x300.jpg

And you have to check, in your OC Source Files, if ALL the VqMod SEARCH / REPLACE Code Line CONTENT is absolutely EQUAL to those, as they have been written in the VqMod, otherways, it will not function!
Ernie

I'm rarely active at the OC Forum lately. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'100+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

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

Post by Jaap » Wed May 24, 2017 10:31 pm

Hi Ernie,

Is the image_sub_domain working with OC2.0.2.0 on Journal theme?

Lint Kopen https://lintenkopen.nl/


User avatar
Active Member

Posts

Joined
Fri Apr 15, 2011 12:10 am
Location - the Netherlands

Post by IP_CAM » Thu May 25, 2017 12:03 am

well, I use neither Journal Themes nor OC v.2 Versions (anymore), so I could not be of help.
Sorry! :'(
Ernie

I'm rarely active at the OC Forum lately. To reach me, contact: jti@jacob.ch
A Demoversion of my free OpenCart LIGHT v.1.5.6.5 Software Edition
can be seen in real Action here: http://www.jti.li/shop/
---
1'100+ FREE OC Extension-Repositories - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
---
Image


User avatar
Legendary Member

Posts

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

Users browsing this forum: Roger Wendover and 33 guests