1

Im looking for ways to increase my page speed.

Currently my website page is 1.4MB, My Page rating is 91, however I still find the site slow. The page load speed on pingdom is 10.4 seconds which is slow.

I have enabled cache and use varnish. I have optimized all images. using leverage browser cache.

Im just battling with javascript and css.

What is the best way to handle these?

I am using a dedicated server running Centos.

  • Are you sure varnish is caching? For a varnished site that is slow. Have you tried merging css/js (system/configuration/developer/merge js/css. Also fooman has created a nice module that also minifies css/js when merged. – ProxiBlue Aug 20 '13 at 9:52
  • Just checked now, my varnish isnt working as expected. I will have to look into it abit more. I have enabled js and css in magento. The fooman addon creates errors on my homepage. – Wessel Aug 20 '13 at 10:35
  • Varnish can be a problematic setup to achieve correctly. The main issue will be sessions. Varnish do not cache when sessions are present. Regarding how to improve your speed, the question is really broad, and there are many resources available on how to improve magento speed. You seem to have covered the most crucial ones already. The only other recommendation is to install Magento Profiler fabrizio-branca.de/magento-profiler.html and see what is causing your bottleneck. This module is in my default tool set. – ProxiBlue Aug 20 '13 at 12:55
5

Varnish just hides the problem, it does not solve it. You will always have non-cached pages, checkout will be non-cached so abandoned carts, and Google knows your cached and non-cached, if they do not match you will be ranked lower.

Top sites do not merge CSS or JS, they just have the highest performing hosting, you do not need any tricks however getting to that is complex. Separate MySQL, separate memcache, separate admin, FPC just adds an extra kick when you have the non-cached correct. Anything more than 3s and you lose 40% of visitors, so this is your target. The problem is that this is top 20%, under 2s top 10%, under 1.5s top 5% and under 1s top 1% (the last two being enterprise class).

So even if you have Varnish working, it will not help your conversions or ranking. Getting this right is part of the secret to increased ranking and conversions which leads to increased revenue. To improve speed like the top retailers, top-tier hosting, it is that simple, and that complex.

This should help, use one of these methods to calculate monthly hosting budget, figures are from enterprise consultants.

Micro Enterprise – Less than $2million revenue/yr & less than 10 employees
Revenue Based: Hosting is 20% of IT spend and IT spend is 5% of yearly revenue / 12mths for monthly hosting budget
Visitor Based:$0.0139 x number of visitors per month for monthly hosting budget
Order Based:$0.50 x number of orders per month for monthly hosting budget

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • Thanks for your very informed post Serpyre. I see your point here. I see allot of sites running magento that are sub 3 seconds. I was just wondering how they actually get to that point, as currently with a well configured dedicated server, I cant anything under 8. – Wessel Aug 21 '13 at 12:31
  • 'Top sites' absolutely do merge and minify JS and CSS - this is about reducing the number of requests per page. You can have the best performing hosting in the world but if your page has lots of JS, CSS and image assets then you are still going to see slow times for the page to finish loading entirely as the every asset is requested individually from the server and browsers can't request more than around 8 assets simultaneously from any one domain. The answer is not always better hosting, but making sure uncached performance is good is definitely key. – Jonathan Hussey Jul 15 '14 at 11:21
  • I'm not on a mission, just correcting inaccurate information. If you look at the source code for 'top sites' i.e. eBay you can see that merged and minified JS/CSS is being used. But yes you are right in that ideas like merging and minification should be applied on top of good hosting. – Jonathan Hussey Jul 16 '14 at 6:10
  • The point I'm making is that the number of requests per page is an absolutely fundamental area to address when considering performance. – Jonathan Hussey Jul 17 '14 at 6:27
  • Insulting. Quoting Google's 'Performance Best Practices' - developers.google.com/speed/docs/best-practices/rules_intro. The top two items are optimizing caching and minimizing round-trip times. Under nimizing round-trip times you will read "Therefore, an important strategy for speeding up web page performance is to minimize the number of round trips that need to be made. Since the majority of those round trips consist of HTTP requests and responses, it's especially important to minimize the number of requests that the client needs to make and to parallelize them as much as possible" – Jonathan Hussey Jul 17 '14 at 9:19
3

David,

As we all know, there are a lot of different variables that go into determining Magento's page speed. It's important to know the number of visitors per day (total), the number of concurrent visitors at any given time, the number of products/sku's, and the type of hardware you're on. Having more insight into your environment will help big time in determining what the issue is. It'd be appreciated if you could provide a bit more information.

Also, Varnish may not be the best solution for your specific site. You can't just simply turn on Varnish and expect it to work. Though, if you're familiar with how to properly set up Varnish, it may be in your best interest to check out (https://github.com/nexcess/magento-turpentine). From Turpentine's github page:

"Turpentine is a full page cache extension for Magento that works with Varnish, a very fast caching reverse-proxy. By default, Varnish doesn't cache requests with cookies and Magento sends the frontend cookie with every request causing a (near) zero hit-rate for Varnish's cache. Turpentine configures Varnish to work with Magento and modifies Magento's behaviour to significantly improve the cache hit rate.

Note that while this extension is now considered stable, it is strongly recommended that it be tested on a development/staging site before deploying on a production site due to the potential need to add custom ESI policies for blocks added by other extensions."

Everyone who I know has used this has been blown away by what it can do. It may be worth checking out if your goal is to further increase page load time while using Varnish. At this point, it's hard to say where the issue is coming from as we don't know the details.

As another resource, I'd recommend checking out Nexcess' White Paper as it provides information about the best and most popular Magento configurations. You may download the Nexcess White Paper at (http://www.nexcess.net/magento-best-practices-whitepaper). It's incredibly thorough and provides some really amazing insight into Magento optimization that is hard to find anywhere else.

Also, as a last thought. Are you using a CDN?

  • 1
    "Redis as Magento's sole backend"? – benmarks Aug 23 '13 at 16:51
  • Whoops! Didn't specify. Redis as Magento's sole cache* backend. Was just trying to point out that it's possible to get ~3s page load times without Varnish at all. – chrisjnas Aug 23 '13 at 17:45
  • Also, removed that portion of my explanation as it was awkward placement probably causing more confusion than good. Considering they're different mechanisms w/ Varnish caching the front end and Redis caching the backend. – chrisjnas Aug 23 '13 at 17:45
1

There are really only 3 areas you need to look at - hosting, time for the first request to complete, and the number of requests per page. Have a look at our blog post covering this here. Also use our performance profiler to get tailored advice on ways to speed up your store.

1

1.4MB is quite a large page especially for those on mobile. One of the techniques you can use ( as recommended by Google PageSpeed) is to optimize images and moving them to a Content Delivery Network) Since Images typically make up 66% of the average trading Ecommerce page- you can get the largest win from doing this.

One of the plugins I have used to do this is the Cloudinary Magento plugin - which does both the optimization, quality adjustment and moving to the CDN without needing to resort to code changes but there are others that will do various parts of the performance increase.

0

you can use magento default JS and CSS file merging under system->configuration->Advanced->developer

this only will work if you have added CSS and JS files in the correct way via local.xml

another option is to merge and minify them manually, for example use sass compilers, JS compilers. codekit for mac is awesome tool for this task.

Else you should check for slow queries and things like loops which gous through all products, they are performance killers.

also extensions for full page caching might help to improve performance.

0

Best way to handle javascript and css is to either merge it or use some sort of CDN. I have used CDN to handle my javasccript and CSS call requests and it helps drastically. You can also use soem sort of full page cache warmer to quickly cache back the pages if you flush/refresh your cache even if once a day. One is like is https://magewares.com/crawler.html, very effective and detailed to show you the pages which are cached.

-1

As @Serpyre said:

Take the database off of the server and put it on a stand alone instance optimised for the database.

Throw as much ram at each machine as you can offer.

Use an instance for Redis to cache Magento cache and 1 more instance for sessions.

Profile your Magento build. You might find that a particular block is the problem.

Also, you have not mentioned the specs of the server or traffic numbers you are seeing. Because if you're seeing 100 concurrent users on the site with 2GB of RAM, it's a different conversation to be had.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.