Post by CaptainHaddock » Thu Sep 12, 2013 9:39 am

Hi,
Does putting images in a subdomain speed up Opencart pages?
I think the idea is that the images can be loaded whilst other page items are being loaded.

I am interested in hearing from people who have sites with images in sub domain, and how much this speeded your site up.

Thanks

Active Member

Posts

Joined
Tue Jul 02, 2013 7:01 am


Post by butte » Thu Sep 12, 2013 10:14 am

The short answer is essentially, no. There are two immediate aspects to fetching whatever kinds of files are segregated, such as into named directories or along with those further-named subdomains, one is looking to the directories whilst already in the tree, the other is passing outside for another divebomb into additionally named subdomains' already named directories in the tree. Staying in retains memory of nested .htaccess, coming back in goes through nested .htaccess from root upward. Some .htaccess can be lengthy, such as for strict restriction of traffic or for some ways of handling engines.

I markedly favor both segregations among directories, as of shops or images or whatever, and among subdomains, as of shops or other essentially standalone aspects of websites. I do not favor putting images or other files into their own subdomains just for the sake of calling them. I do tend to favor putting downloadable files along with up- and downloading software in subdomains restricted to those files and folks, primarily as a functional standalone aspect of a website.

Every subdomain requires attention to its own dns records, forwarding, mail if given that, and the like, from registrar on down to local .htaccess files' final controls of the traffic. Putting images or audio or whatnot into their own subdomain(s) adds traffic complexities ranging from nameservers down through .htaccess files, as well as the nuances of the operating system fielding all of that inbound. As surely as you can bog down your own machine by giving it enough to do, servers can be slowed. Examples include the superfluous but moreover counterproductive local in-house traffic when runaway sessions, runaway "friendly" files, duplicitous looping among proliferating links that fundamentally all go to exactly the same far fewer places, and other situations consume server resources in what was supposed to smooth everything and seemed like a good idea at the time but went south. "The Letter" from one engine, and the summary shutdowns by hosts, derive from those sorts of runaways. Overall the speed gain observable by putting images in their own subdomain is probably negative (speed loss), and the traffic increase to loop out and back is probably counterproductive (wasted clock cycles). The more numerous the files, the less trivial the consequences become.

Another aspect is calling images lying outside the domain or subdomain calling them. Modern browsers are settable to handle such traffic by alerts or to prevent it. If the several subdomains are on one machine, traffic is focused there; if on plural machines, the machine addresses are "outsiders" from some perspectives.

So, no.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by MarketInSG » Thu Sep 12, 2013 7:11 pm

lol. just read his last line. Get a cdn if you want to speed things up
So, no.


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by CaptainHaddock » Fri Sep 13, 2013 6:31 am

Thanks Butte, excellent reply that got me thinking about some aspects I had not considered.
You've pretty much persuaded me it's not worth it, but.... I found this good discussion http://css-tricks.com/images-on-a-subdomain/
It seems like some people have definitely speeded up their sites using a sub domain for image storage.

It would be great to hear from someone who has actually implemented image storage on a sub domain for an Opencart site, and measured speed difference using tools like gtmetrix.com or http://www.webpagetest.org
Then we would have some facts to compare with our opinions/logic.

Active Member

Posts

Joined
Tue Jul 02, 2013 7:01 am


Post by CaptainHaddock » Fri Sep 13, 2013 6:35 am

MarketInSG wrote:lol. just read his last line. Get a cdn if you want to speed things up
So, no.
Have been thinking about trying Cloudflare. Bit put off as free version does not easily work with SSL - its a bit of hassle as I'd need to change main domain to include www.

What CDN (S) have you used. What speed gains did you get?

I will start a thread when I get time documenting the changes I have made for speeding up the site and their performance gains. Bottom line is I got big gains with free and quite easy changes. The extension I paid a lot for made virtually no difference.

Thanks

Active Member

Posts

Joined
Tue Jul 02, 2013 7:01 am


Post by butte » Fri Sep 13, 2013 7:21 am

Overall the "first subdomain" www. is worth using, as is the trailing "/".

The discussion link covers alternative views, but doesn't couple them to nuances of server setups and maintenance (including Linux distributions, php versions and .ini, and whatnot), having separate or same registrar and webhost, .htaccess, etc., down to minima, modes, and maxima of file sizes and numbers, even of path strings and filespec strings in bytes. There is more about which to be very picky than is ordinarily mentioned, although there must be some admirably picky computer engineering papers about it.

Those are also not ordinarily seen in velocity tests (in jest, of electrons confined to communications devices, slower than electromagnetic c). Many of the velocity tests are as good or poor and variable as a typical Holstein with a typical radar gun or laser gun on a road shoulder in all weather, watchin' out for y'all. Some of them lie.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by CaptainHaddock » Fri Sep 13, 2013 8:29 am

Butte,
This is a bit off topic...
To change my domain to begin www , do I simply need to edit the config files? I have searched the support forum but haven't found anything about this. Thanks

Active Member

Posts

Joined
Tue Jul 02, 2013 7:01 am


Post by butte » Fri Sep 13, 2013 12:12 pm

Essentially every domain has a usable http://www., it is "the first" subdomain by default. There is in the registrar's dns records a place (either obvious or implicit) for "zone" and there for * and http://www.; and there is a place in .htaccess for http://www.; and there are several HTTP and HTTPS rows in config.php (pair) for http://www.; and ideally they all work together. Some browsers honor, even enforce, the www. but don't show it in the address bar (in Firefox, for example, http://www. often won't show but swiping, copying, and planting the URL reveals, lo, the missing http://www.).

It's on-topic, part of whazzat and how.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by MarketInSG » Fri Sep 13, 2013 1:13 pm

CaptainHaddock wrote:Butte,
This is a bit off topic...
To change my domain to begin www , do I simply need to edit the config files? I have searched the support forum but haven't found anything about this. Thanks
he is usually off topic, or a little high...

anyway, you can try maxcdn, or other cdn. It will definitely help


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by butte » Fri Sep 13, 2013 10:58 pm

If you read in English what you quoted in English, then you might perceive that his "This" refers to his own question, which in turn is palpably and prima facie on-topic. As-is your ad hominem attack in vacuo boomeranged.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by Cue4cheap » Wed Jan 15, 2014 9:20 am

So back on topic, is there any advantage to using a sub-domain for images?

I am at the point of looking at options for speed and the like. Anything that I can gain an edge.

Mike

cue4cheap not cheap quality


Expert Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by butte » Wed Jan 15, 2014 10:26 am

Noop. As I noted, and as he implied by way of coin, and as you came back with it, no. If there were an edge I would not have said no and he would not have said coin. There's no effective edge. Gathering images into a directory minimizes running to and fro to fetch them, although each instance is its own string -- the machine won't "think" ahah! image! till it finds the extensions .jpg or .png even if it starts with /image/. Placing that directory into its own subdomain can serve other purposes, but to reach it in successive loops requires going back through the address train in order to land all over, again, on the subdomain (or to call from it). If I had to flip a coin I would call the side for no subdomain. Short anwser, still no.

. . . In reading something else afterward, I see that you should look at these links:
2011.-- http://forum.opencart.com/viewtopic.php ... 34#p194567
2011.-- http://forum.opencart.com/memberlist.ph ... ile&u=1720 to http://forum.opencart.com/viewtopic.php ... 75#p194975
2013.-- http://forum.opencart.com/viewtopic.php ... 34#p458502
2014, different context, where it popped up.-- http://forum.opencart.com/viewtopic.php ... 19#p467841
There's no emphasis there upon gaining speed, but the alternative means of addressing is intriguing, so I'll stick with no and allow for coin.

Guru Member

Posts

Joined
Wed Mar 20, 2013 6:58 am

Post by TomTesla » Thu Mar 27, 2014 9:09 pm

the answer is yes, extra subdomains loading css,js,images will speed up static resources loading in client browser.

you can look at this post:
http://stackoverflow.com/questions/9854 ... -a-browser

by the way you can add multi subdomain to speed up loading with opencart CDN extension.:
http://www.opencart.com/index.php?route ... cart%20cdn

New member

Posts

Joined
Mon Jan 13, 2014 11:56 am

Post by Anil Damiwal » Tue Jun 17, 2014 3:08 pm

this is my config file. I have changed for image subdomain but images do not load.


// HTTP
define('HTTP_SERVER', 'http://a2zfitnessmart.com/');
define('HTTP_IMAGE', 'http://img.a2zfitnessmart.com/');
// HTTPS
define('HTTPS_SERVER', 'http://a2zfitnessmart.com/');
define('HTTPS_IMAGE', 'http://img.a2zfitnessmart.com/');

// DIR
define('DIR_APPLICATION', '\www.a2zfitnessmart.com/catalog/');
define('DIR_SYSTEM', '\www.a2zfitnessmart.com/system/');
define('DIR_DATABASE', '\www.a2zfitnessmart.com/system/database/');
define('DIR_LANGUAGE', '\www.a2zfitnessmart.com/catalog/language/');
define('DIR_TEMPLATE', '\www.a2zfitnessmart.com/catalog/view/theme/');
define('DIR_CONFIG', '\www.a2zfitnessmart.com/system/config/');
define('DIR_IMAGE', '\img.a2zfitnessmart.com/');
define('DIR_CACHE', '\www.a2zfitnessmart.com/system/cache/');
define('DIR_DOWNLOAD', '\www.a2zfitnessmart.com/download/');
define('DIR_LOGS', '\www.a2zfitnessmart.com/system/logs/');

Newbie

Posts

Joined
Tue Jun 17, 2014 2:57 pm

Post by hillfingerr » Sun Jun 22, 2014 7:46 am

Did anyone solve this? It's not working...

New member

Posts

Joined
Mon May 26, 2014 8:22 pm

Post by TomTesla » Mon Mar 16, 2015 9:43 pm

you neednt to put images in subdomain. you can describe it loading images by subdomain. then


the extension http://www.opencart.com/index.php?route ... cart%20cdn can solve your problem.

New member

Posts

Joined
Mon Jan 13, 2014 11:56 am
Who is online

Users browsing this forum: No registered users and 205 guests