Improving the Speed of XenForo

System0

Active member
I am currently optimising all my WordPress websites for a book I am writing on the same subject. I am looking to do the same with my three XenForo forums.

A quick review shows that there are a number of things that I need to address such as:
  • Specify image dimensions
  • Defer parsing of JavaScript
  • Optimize the order of styles and scripts
  • Minify CSS
I can do many things myself such as combing images using CSS sprites and reducing calls to external services (Damn Adsense ads!); however I am not sure what is the best way to approach some of the other issues.

For example, is there a way to modify XenForo so that image dimensions are always defined? Likewise, a way to automatically place all Javascript just before the closing tag?

Would love to hear from those of you who have optimised your forums and improved your PageSpeed and YSlow scores.

Kevin
 
Xenforo out of box and server side cache works very well. I would be very interested in knowhing how you achieve all the goals you have set. Would be great if I could improve my own forums as well.

I just did a test for you to show how a default out of the box xenforo home page would load coupled with server side cache : http://www.webpagetest.org/result/130826_55_QMJ/

This is using DSO as php handler with nginx as proxy to apache and php 5.3 along with APC. I hope this helps.
 
Levering server side caches will help also.

Thanks Slaiv. I've sent an email to my host for advice on this.

Xenforo out of box and server side cache works very well. I would be very interested in knowhing how you achieve all the goals you have set. Would be great if I could improve my own forums as well.

I just did a test for you to show how a default out of the box xenforo home page would load coupled with server side cache : http://www.webpagetest.org/result/130826_55_QMJ/

This is using DSO as php handler with nginx as proxy to apache and php 5.3 along with APC. I hope this helps.

Yeah that is very quick. The repeat viewing was only 0.425 seconds. The goal should be for all of us to get as close as we can to that.

Fewer add-ons.... Which is a big problem for me, because I love adding little toys.

It is for me too. That is what I am going to address. I have three forums. Two are active and one gets very little traffic. So the one with low traffic will be the one I am going to do my testing with (as well as upgrading to the latest XenForo).

I just rated the one with low traffic and GTMetrix showed:

Page load time:
5.22s
Total page size: 863KB
Total number of requests: 57

I then disabled all add-ons and tested again and got this:

Page load time: 2.76s
Total page size: 706KB
Total number of requests: 25

It's encouraging to see so the number of requests decrease so much. My busier forums currently have a total of 130 and 78 respectively. So I imagine that I will see a bigger improvement there if I uninstall some add-ons.

I believe many add-ons can be removed and cannot be considered essential, however the anti-spam add-ons will need to be kept due to the spam problem that all forums seem to have.

I suspect if attachments in posts had dimensions, they would not resize automatically to fit the viewable area of the monitor when the browser window is resized.

That is something I had not considered. Good point.
 
I am still working on optimising my forums. One of the biggest causes of my page load is Javascript not being placed before the closing tag (it is adding close to 300kb). I am unsure how to do this through XenForo. The old plugin XF Optimise did this but it is no longer supported. Is there a manual way of doing this?
 
I've suggested moving the JS numerous times but they don't seem willing to make the change for whatever reason :rolleyes:
 
GTMetrix reports that it is the biggest thing slowing down my forums. You would think that would make it a priority.
 
I think on "PAGE_CONTAINER" template.
Move this line:
Code:
<xen:include template="google_analytics" />
<xen:include template="page_container_js_head" />
Above "</body>"
 
I think on "PAGE_CONTAINER" template.
Move this line:
Code:
<xen:include template="google_analytics" />
<xen:include template="page_container_js_head" />
Above "</body>"

Hi RoldanLT,

I tried this but when I try to Reply to a post I get this error message:

pic001.webp
 
Javascript should be loaded directly before the closing body tag. GTmetrix advises that for my forums, I will save up to 400kb doing this.
Are you sure about that? There is no bandwidth saving by moving JS to that location. There is only one advantage is to load CSS & HTML first to speed up page rendering.
 
Yes, it reduces the time on the first page rendering. That is what Google and other search engines are using to check the speed of websites. Google have been very open about the fact that search engine rankings use the speed of a website as a factor. Their PageSpeed service advises Javascript to be moved to the bottom.
 
Bandwidth is not the issue here. It is about:

  1. Loading pages quicker for users.
  2. Getting a faster page speed in order to get better rankings in search engines.
Resolving this issue could upgrade my YSlow rating from C to A. It is important and needs to be addressed.
 
Bandwidth is not the issue here. It is about:

  1. Loading pages quicker for users.
  2. Getting a faster page speed in order to get better rankings in search engines.
Resolving this issue could upgrade my YSlow rating from C to A. It is important and needs to be addressed.
I agree with you. I just want to talk about your words about "saving 400kb". Other than that, completely agree with you.
 
Top Bottom