Register Arama Bugünkü Mesajlar Tüm Forumu Okundu Say

Thread Tools
Speed up XenForo site
TTayfun's Avatar
TTayfun has a brilliant futureTTayfun has a brilliant futureTTayfun has a brilliant futureTTayfun has a brilliant futureTTayfun has a brilliant futureTTayfun has a brilliant futureTTayfun has a brilliant futureTTayfun has a brilliant futureTTayfun has a brilliant futureTTayfun has a brilliant future
Gerçek Ad: Tayfun T.
Kayıt Tarihi: Nov 2017
Mesajlar: 170

Güzergah: Istanbul Anadolu
Show Printable Version Email this Page
yazan TTayfun 30 Dec 2017, 01:46
Oylama: (1 oy - 5.00 ortalama)

I've been working pretty hard to get my XenForo forums speedy and thought I'd share some lessons learned here. This isn't meant to be comprehensive where I explain everything. More of a checklist.
Some of these are rather obvious, for example...

1) Get a good host and a powerful server.

I use and recommend Hivelocity, but there are lots of good hosts.

2) If you have a dedicated server running Apache, disable httaccess. Move all httaccess directives to httpd.conf first so that you can keep any necessary rewrites in place.

See: Apache Performance: Disable .htaccess

I'm currently running Nginx by way of Centmin Mod LEMP.

3) Add expires headers (leverage browser caching).

See: Leverage browser caching | GTmetrix

4) Enable gzip compression.

See: Enable gzip compression | GTmetrix

5) Utilize front-end caching.

See: Defining a Cache | XenForo

I use Zend OpCache for opcode caching (comes with PHP 5.5 or higher)

6) Utilize back-end caching.

See: Defining a Cache | XenForo

I use Redis cache:

7) Consider utilizing page caching for guests

Caching pages for guests may help performance if a lot of your traffic is guest traffic. There are different ways to cache pages for guests depending on your setup:

[bd] Cache:

DragonByte Optimise:

Nginx fastcgi_cache:

LiteSpeed cache:

Cloudflare "Bypass Cache on Cookie" (Business and Enterprise plans only, $$$):

Varnish cache:

8) Tune MySQL (or MariaDB or Percona).


Side note: I hired @MattW to setup my server, caching, MariaDB, and much more. Highly recommend his services! (no relationship other than happy customer). See:

9) Don't use Google Integration.

It's nice for members to be able to sign in with Google (OAuth), but there is a big hit to page loading speed. Not worth it to me. I also removed Facebook likes from thread pages because of a small associated performance hit from that.

10) Disable unnecessary features and addons, especially if test sites such as show that they are slowing your page.

11) Enable Minify CSS (under Options > Performance)

The exception to this would be if you are already using something else to minify CSS, eg, [bd] Cache or DragonByte Optimise combined with either Pagespeed module or Cloudflare .

12) Experiment with different jQuery sources (also under Options > Performance)


I use Google as my jQuery source. It isn't the fastest in my testing, but it's likely that visitors will already have it cached.

13) Delete the contents of sidebar_share_page template (social sharing) to increase front page load times. You can always revert if you want those back.

14) Get rid of low-performing ad networks, and minimize the number of ad passbacks (redirects).

In particular, try to avoid ads that block page render.

15) Try a CDN to see if it makes a difference for your site. I've used MaxCDN, CloudFlare, CloudFront, and KeyCDN. All have their good and bad points.


You can use to test site performance from different geographic regions.

There are a couple addons which allow you to put your attachments on CDN:

[Tinhte] Image Attachment Optimization & CDN Support:

[bd] Attachment Store:

Keep in mind that there is some risk involved if you use the [bd] addon to move your attachments to a new location. You become dependent on the developer to continue timely support. The Tinhte addon leaves your files in place and rewrites their URLs.

Currently, I use the Tinhte addon to serve image attachments via KeyCDN.

Cloudflare will automatically serve attachments via CDN without needing either of the above two addons. Just use a custom page rule to cache the attachments in their edge servers. Here is the one I used when my sites were on Cloudflare:

Putting Xenforo CSS on a CDN requires either [bd] Cache or DragonByte Optimise to convert CSS to file or the use of a Cloudflare custom pagerule to cache css.php*.

16) Defer javascript to the extent possible without breaking your site. This can be done in a variety of ways, including mod_pagespeed or CloudFlare. There are also three addons that can do this for you:

Defer JS:

[bd] Cache:

DragonByte Optimise:

If you want to make sure that a particular javascript isn't called until after the page loads, you can use the method described here:

I use the Defer JS addon to defer javascript.

17) Optimize image attachments and avatars on your server.

There are a couple addons which do this:

[Nobita] Image Optimizer:

GoodForNothing Image Optimizer:

Tip: Make sure you have good backups of your attachments before using any image optimizer.

18) Consider using an image delivery system which optimizes images further.

One easy option is to use Cloudflare (Pro or higher tier) which has built in image optimization functions (Polish and Mirage). Polish now includes the option to automatically convert images to webp for browsers which support that.

If you use the Tinhte or [bd] addons mentioned above to put attachments on CDN, you can use one of the CDNs that do additional image optimization (resizing, webp conversion, etc). There are a number of companies which do this, including Cloudinary, Imgix, Imagefly, and others.

One of these, ImageEngine by ScientiaMobile, resizes and optimizes images based on detection of the visitor's device. Some of the others claim to do the same thing, but they require a lot more configuration including modifications to your Xenforo setup. ImageEngine works right out of the box. Very simple setup if you use it with the Tinhte addon.

19) Try mod_pagespeed if you use Apache or ngx_pagespeed if you use Nginx.

The Pagespeed module can do many different optimizations for html, css, javascript, and images.


Pagespeed is a very effective way to resize images for mobile. Unlike ImageEngine it requires multiple page loads to optimize resources for mobile, but once it does so, the results are dramatic.

With Pagespeed:

Without Pagespeed:

20) Try lazy loading images.

This can be done with Pagespeed module and [bd] Attachment Store together, or you can use this addon instead:

21) Offload attachment file serving.

You can do this using [bd] Attachment Store. Or if you use Nginx, then this addon provides another option using Nginx's X-Accel-Redirect:

22) If possible, use http/2.


23) If possible, use PHP7


24) Leave automatic serialization off unless you use an addon that requires it.

Kod Blok Kilitli:      (Kayıt veya giriş yapmalısın)  
Engellenmiş, kayıtlı olmayan veya onay bekleyen kişiler kodlara erişemezler.

Note that you will need to clear your cache after changing this setting!


25) Consider adding preload hints for web fonts (if you use them)


As always, make sure you test. Preloading web fonts may help or hinder performance depending on the rest of your setup.

See also:

I use the following after the <head> tag in PAGE_CONTAINER to preload Lato and Font Awesome on my sites. Has definitely improved performance.

Kod Blok Kilitli:      (Kayıt veya giriş yapmalısın)  
Engellenmiş, kayıtlı olmayan veya onay bekleyen kişiler kodlara erişemezler.

Some sites you can use to test site performance:

Keep in mind that the letter scores you get from those sites aren't necessarily reflective of real-world speed.

[Source]: İçerik Kaynağı

Views: 189
Reply With Quote

Thread Tools

Şunları Yapabilirsin
Yeni Konu Açmak
Konuya Cevap Yazmak
Eklenti Eklemek
Düzenleme Yapabilmek

Forum Atla

LD'de Yeni misin? Yardıma mı ihtiyacın var?

All times are GMT +3. The time now is 11:05.

Tasarım Özelliği | Genişlik: Geniş Renk: Speed up XenForo site Speed up XenForo site Speed up XenForo site Speed up XenForo site Speed up XenForo site