X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Website too slow (https://forum.x-cart.com/showthread.php?t=66582)

aloha1 04-04-2013 05:39 PM

Website too slow
 
Hello,

We would like to know why our new website home page is taking so long to load.
Most of the time it takes about 45 seconds to completely load the page.

http://www.star500.com/shop/home.php

Can anyone tell me what the problem could be?

I am running version 4.5.4

Thanks

fersal6 04-05-2013 09:59 AM

Re: Website too slow
 
Your home page loaded in 5-10 seconds on my laptop under Chrome. In any case, check the size of your banner image.

bigredseo 04-08-2013 06:39 AM

Re: Website too slow
 
The home page is about 1.1MB in size, and from our tests you're running less than 5 seconds. When I ran through http://tools.pingdom.com

There's connections out to facebook that could be causing some of the slowdown - can you try temporarily disabling those modules?

The "feat_children.png" image is also not loading. As a result, it'll slow down the site as it continues to try to load (http://www.star500.com/shop/skin/electronics_black/images/feat_children.png)

If you could combine some of your regular images like your forward/back arrows and lines and make them into a sprite - that would speed up things too. Also, pulling some of the data from a separate subdomain would help too. You could easily setup "template.star500.com" as a subdomain, point it to your template folder and have some of your more common template parts of X-Cart pull from that subdomain. A browser can pull data from 5 different domains(subdomains) at a time, but only pull 2 items of data per domain - that means it has to wait on "A & B" to deliver before sending "C". If you were using even ONE extra subdomain, you'd be delivering "A & B" and "C & D" at the same time.

Personally, it loaded fast for me, so it might have been a server load issue too.

jacob1978 04-29-2013 12:48 AM

Re: Website too slow
 
Also a lot of javascript is loaded or being loaded at the first time. It took me around 35-40 seconds to get the home page apear. The second time I went to your site was a lot faster.. I have had an excact same problem with a previous webshop of mine, a lot of javascript was running on the homepage and my site was really slow. I disabled a few javascripts and the site was loading a lot faster, 15-20 seconds faster. I changed a lot on the home page and made the most CSS driven. I took out several javascripts also. Plain and simple.
I know, some elements running on java that's why I turned my design completely around and now I have a fast site, home page also. I don't have many javascripts anymore and running now on xtreme gear template of the Xcartstore.com.

The site looks great though.

I think its a few issues bundled in one that causes the site to slow down.

philrisk 04-30-2013 05:56 AM

Re: Website too slow
 
Make sure you have these options ticked in general settings.

Optimization settings:
1. Use speed-up tool for Javascript
2. Use speed-up tool for CSS
3. Do not check if templates are changed (Smarty compile_check).

DavyMac 05-07-2013 05:38 AM

Re: Website too slow
 
Conor, using a subdomain to provide components of a page is an interesting idea that I'd not come across before. If a site were to store commonly used images on a subdomain are there any significant SEO negatives associated with it, that you are aware of?

bigredseo 05-07-2013 06:45 AM

Re: Website too slow
 
No negatives really. For the most part, you're not optimizing your images to show in the "IMAGES" tab on google, so you may not get people clicking (and stealing) your images that way. That being said, naming your images for SEO purposes is still recommended.

I've used the multiple subdomain approach for many years. Between images, content, sprites and CSS, we have 5 different subdomains that we pull information from on a page load. They're all on the same machine too, so there's no fear that one subdomain will work and the other doesn't - resulting in a broken site.

Of course, with the advantage of CDN's, that makes things really fast too, but even still, we use a subdomain at the CDN for images, and another for CSS.

Never had a problem.

DavyMac 05-07-2013 07:02 AM

Re: Website too slow
 
Thanks Conor, I'll give it a go.

Just wondering though, will the leverage browser caching in my root folder .htaccess file apply to my subdomains, or do I need to set that up in an htaccess file within each subdomain folder? I don't want to assume it does.

philrisk 05-08-2013 07:21 AM

Re: Website too slow
 
Quote:

Originally Posted by handsonwebhosting
No negatives really. For the most part, you're not optimizing your images to show in the "IMAGES" tab on google, so you may not get people clicking (and stealing) your images that way. That being said, naming your images for SEO purposes is still recommended.

I've used the multiple subdomain approach for many years. Between images, content, sprites and CSS, we have 5 different subdomains that we pull information from on a page load. They're all on the same machine too, so there's no fear that one subdomain will work and the other doesn't - resulting in a broken site.

Of course, with the advantage of CDN's, that makes things really fast too, but even still, we use a subdomain at the CDN for images, and another for CSS.

Never had a problem.


I use MaxCDN with 4 pull zones pulling in different lots of content. Definitely helps on page load times.

DavyMac 05-09-2013 10:13 AM

Re: Website too slow
 
I would very much like to assign resources to a subdomain but in 4.5.4 it is not clear where the image folders are assigned. In older versions I'd just reassign $imagedir to be the subdomain, but I'm at a loss with this version.

Can anyone point me in the right direction please? Has anyone set resources to be on a subdomain in 4.5.*?

carpeperdiem 05-09-2013 11:05 AM

Re: Website too slow
 
Quote:

Originally Posted by DavyMac
I would very much like to assign resources to a subdomain but in 4.5.4 it is not clear where the image folders are assigned. In older versions I'd just reassign $imagedir to be the subdomain, but I'm at a loss with this version.

Can anyone point me in the right direction please? Has anyone set resources to be on a subdomain in 4.5.*?


This may help:

http://forum.x-cart.com/showthread.php?t=64443

my post #57 has a summary of the file edits. That could be useful for subdomains as well -- HOWEVER -- I'd invest $20 and try a CDN before doing it yourself.

DavyMac 05-10-2013 12:24 AM

Re: Website too slow
 
Quote:

HOWEVER -- I'd invest $20 and try a CDN before doing it yourself.

Thanks for your reply, and by the strength of your advice I sense I really should look into a CDN.

carpeperdiem 05-10-2013 04:05 AM

Re: Website too slow
 
I would look for a 50% off coupon for MaxCDN and just follow my guide in post #57
EWD may have an affiliate link/discount code
Hands-on had one for me.

BEFORE you go with a CDN, benchmark your site.
http://www.webpagetest.org/

Then after about 24 hrs (allow caching to complete) benchmark again. Watch your page load speeds drop by 50% or more. :-)

DavyMac 05-10-2013 06:13 AM

Re: Website too slow
 
Quote:

Originally Posted by carpeperdiem
I would look for a 50% off coupon for MaxCDN and just follow my guide in post #57
EWD may have an affiliate link/discount code
Hands-on had one for me.

BEFORE you go with a CDN, benchmark your site.
http://www.webpagetest.org/

Then after about 24 hrs (allow caching to complete) benchmark again. Watch your page load speeds drop by 50% or more. :-)


Great advice, which I will certainly follow - thanks.

bigredseo 05-10-2013 08:41 AM

Re: Website too slow
 
No more MaxCDN coupons on my end - the only thing I have left these days is just our affiliate code where we'd get $20 if you signed up under our link on our site.

That said, if you use "MaxCDNcoupon" on checkout, you'll save 25% on addition to the already 50% off for your first year.

I've been with MaxCDN for 3 years now - love it!

philrisk 05-12-2013 11:25 PM

Re: Website too slow
 
For setting up MaxCDN you modify these two files smarty.php, func.files.php. I guess you would do the same for a sub domain.

DavyMac 05-12-2013 11:56 PM

Re: Website too slow
 
Quote:

Originally Posted by philrisk
For setting up MaxCDN you modify these two files smarty.php, func.files.php. I guess you would do the same for a sub domain.


Thanks Phil.

When I saw how easy it was to set up and use a CDN I didn't give using a subdomain a second thought. I'm totally sold on CDNs and saw an immediate and huge improvement on website speed. :D/

bigredseo 05-13-2013 09:34 AM

Re: Website too slow
 
Quote:

Originally Posted by DavyMac
Thanks Phil.

When I saw how easy it was to set up and use a CDN I didn't give using a subdomain a second thought. I'm totally sold on CDNs and saw an immediate and huge improvement on website speed. :D/


Combine your CDN with SubDomains and you get the extra speed - that's what I do :) Multiple subdomains point to the single CDN instance results in parallel downloading and faster speed.

carpeperdiem 05-13-2013 09:48 AM

Re: Website too slow
 
Quote:

Originally Posted by handsonwebhosting
Combine your CDN with SubDomains and you get the extra speed - that's what I do :) Multiple subdomains point to the single CDN instance results in parallel downloading and faster speed.


Conor,

You knew that suggesting this would open a can of worms ;-)
Can you share how using subdomains with the cdn can be setup on my hands-on VPS?
Is it simply a matter of creating additional subdomains in cPanel?
Ok, then how do we tell x-cart to use the subdomain instead of the normal location? Care to share?

Does this mean I need an additional account with the cdn?

Not really getting my thick head around it. Must be a monday thing.
thanks,
J

DavyMac 05-14-2013 02:52 AM

Re: Website too slow
 
I had a go. I created a subdomain and redirected to my CDN CNAME but it resulted in "Oops! This link appears to be broken".

bigredseo 05-15-2013 09:25 AM

Re: Website too slow
 
The extra step integration into X-Cart I'm not too familiar with unfortunately. I've performed the steps in our own website but it's a Wordpress website and integrated using that.

With regards to the various subdomains - you can see them on our website as http://cdn1.handsonwebhosting.com up through cdn6
We then call all CSS calls from css.handsonwebhosting.com

I guess, using some creativity and programming, you could setup say 6 subdomains (cdn1, cdn2, cdn3 etc) and then making the system choose at random to pick from 1, 2 or 3 on each call. It would definitely require more overhead computer power though.

Here's an output of how the CNAME for the different subdomains would look- http://www.digwebinterface.com/?hostnames=handsonwebhosting.com%0D%0Acdn2.handson webhosting.com%0D%0Acdn...4&nameservers=

carpeperdiem 08-11-2013 05:19 AM

Re: Website too slow
 
Hi Conor (and everyone),

My page load is getting better and better -- with the new VPS running SSD storage, the bottlenecks at the hardware are all but eliminated. Google pagespeed for home page is 94! Almost there...

I am using this technique to set header caching (as described in the Hands-on help file:
https://billing.handsonwebhosting.com/knowledgebase.php?action=displayarticle&id=294

ExpiresActive On
ExpiresByType image/gif A29030400
ExpiresByType image/png A2419200
ExpiresByType image/jpg A29030400
ExpiresByType image/x-icon A29030400
ExpiresByType application/pdf A2592000
ExpiresByType application/x-javascript A604800
ExpiresByType text/plain A2419200
ExpiresByType text/css A604800

But there are two js cache files not getting their headers set...

Code:

Leverage browser caching of static assets: 56/100
FAILED - (No max-age or expires) - http://cdn.domain.com/var/cache/1.bab2d500e39174a1c1761b556d4cf94f.js
FAILED - (No max-age or expires) - http://cdn.domain.com/var/cache/2.ab3e3d778d98b7f08bb365608526cf07.js


Any idea what could be preventing the js files coming from the cdn to have the expires headers not set by htaccess directives?

Could it be that x-cart is not setting the file type correctly?

Vacman 08-11-2013 10:02 AM

Re: Website too slow
 
Nice tip on the header cache. Are those the settings you are using "ExpiresByType"?

If so, I wonder what happens if you change one of the images (re-upload), etc?

bigredseo 08-11-2013 10:16 AM

Re: Website too slow
 
I'm guessing that since the JS isn't getting accepted by the expires types, that's where the issue sits.

Try adding this to the bottom:


Code:

<filesmatch "\.(js)$"="">
    ExpiresDefault A43200
</filesmatch>


43200 is 12 hours... (seconds x minutes x hours) 60*60*12=43200 seconds

So instead of a ExpiresByType, we're using an "FilesMatch". See if that helps resolve the issue.

The other idea would be to log into your control panel with your CDN and see if they have a section to allow you to add files or directories to a Custom File List. Possibly you can set from in there and it would set the headers on their end.

I've also seen the ExpiresByType set to the following:

Code:

ExpiresByType text/javascript A43200
So rather than being an "application/x-javascript" the type is "text/javascript". See if that makes a difference. I know it used to work the other way when I wrote the article, but maybe things have changed in newer browser versions.

carpeperdiem 08-11-2013 06:06 PM

Re: Website too slow
 
Quote:

Originally Posted by handsonwebhosting
Try adding this to the bottom:


Code:

<filesmatch "\.(js)$"="">
    ExpiresDefault A43200
</filesmatch>


Server error.
Quote:

ExpiresByType text/javascript A43200
Didn;t work.

I'll reach out to MaxCDN as suggested, and report back.

Thanks!
J

carpeperdiem 08-13-2013 10:22 AM

Re: Website too slow
 
Just noticed that the cached js files also fail the header caching if https, and NOT coming from cdn (I have the cdn set to only grab http, and not https):

Quote:

Leverage browser caching of static assets: 73/100
FAILED - (No max-age or expires) - https://www.domain.com/var/cache/1.d571e9300a96df62e63bf55f6e57eb42.js
FAILED - (No max-age or expires) - https://www.domain.com/var/cache/2.ab3e3d778d98b7f08bb365608526cf07.js

SO this is not cdn related.
Hmm...
Any other ideas?
thanks,

J

DavyMac 08-13-2013 10:39 AM

Re: Website too slow
 
Quote:

Originally Posted by carpeperdiem
Any other ideas?
thanks,

J


Personally I use
Code:

ExpiresByType application/javascript "access plus 1 month"

carpeperdiem 08-13-2013 10:46 AM

Re: Website too slow
 
Quote:

Originally Posted by DavyMac
Personally I use
Code:

ExpiresByType application/javascript "access plus 1 month"


Bingo.
Thanks!

Can you share your entire ExpiresByType, if you don't mind?

Thanks!
J

DavyMac 08-13-2013 10:55 AM

Re: Website too slow
 
Quote:

Originally Posted by carpeperdiem
Bingo.
Thanks!

Can you share your entire ExpiresByType, if you don't mind?

Thanks!
J


That's great! pleased I could help.

Here is my Leverage browser caching:
Code:

ExpiresActive On
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/html "access plus 1 month"
ExpiresByType application/x-javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"


I've noticed that I don't cater for pdf's, so I'll need to sort that out.


All times are GMT -8. The time now is 08:52 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.