Onforum.net - Web and gaming resource community

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members .

Optimize xenForo For Less Server Load and Better User Experience

Sonia

Administrator
Administrator
Credits
1,338
XenForo usage is growing because of its built-in SEO features, responsive and modern design, very active development and growing community with numerous available add-ons.



How to Optimize xenForo?
XenForo can be resource heavy if you have too many addons installed with a lot of activity by members.

Here are 10 tips to make your xenForo forums run smoothly with optimal server performance to provide a better user experience and eradicate errors.
1. HTTPS
Chrome and Firefox issue a warning if a site doesn’t use HTTPS secure connection for pages that has password fields.

non-secure.png

Having an SSL certificate for your domain is an absolute must to make sure users do not see these warnings. Once you have the HTTPS configured, redirect HTTP site to HTTPS using .htaccess.

Add the following code to .htaccess file


Once redirected, Configuring HTTPS for xenForo is simple and you can proxy the image URLs for image embed that aren’t on HTTPS that user may have embedded in post content.

Login to admin > Options > Messages and enable proxy images.

proxy-images.png


Note: If images are embedded in posts from your own domain, the redirect from HTTP to HTTPS will break the images because the proxy won’t work on the redirected images.

2. Use a CDN
You can move images, JavaScripts, CSS hosted on a CDN to allow user for parallel download of those resources as well as keep bandwidth and processing on your server low.


3. Server Side Caching
XenForo works amazingly well with caching and you can see that in this thread here.

Set up APC and memcache on your server and then all you need is add few lines of settings code in your config.php file to get it up and running.

If you have server-side caching enabled, you can opt to minify CSS and serve templates through files.

Note: Server side caching may not be possible if you are on shared hosting.

4. Minify CSS / Templates as files
There are options to improve performance of xenForo forum at Admin > Options > Performance.

Minify CSS and serving templates from files instead of from database should definitely be considered.

1_performance.png

You should enable minified CSS and public templates as file only if you have server side caching enabled.

If you don’t have server-side caching enabled, go for Enable Delayed Insert SQL Queries and Cache BB Code output.

5. jQuery CDN vs Locally Hosted
Use Google CDN to fetch jquery instead of hosting it on your own server or on your own CDN. It helps to be served as cached for a user and if not it will be downloaded parallelly for user giving faster user experience.

6. Defer JS
By default xenForo moved JavaScript’s to the bottom of the page just above the tag but if you are using any custom addon that puts JavaScript in the header, you can add Use DeferJS plugin to move it to the bottom of the page or manually edit templates to load scripts as late as possible for faster page rendering.

7. Fewer Add-Ons
Add-ons by newbies can be an issue in Xenforo. Everything in xenForo works on hooks that can be called multiple times but may not be needed to call so many times.

As an example, if an addon uses template hooks, a page can have multiple hooks executed and if the addon avoids an event hint, the hook function will be called multiple times unnecessarily.

hooks.png

Leaving the Event Hint blank is never recommended. Make sure each of the addons that you are using has event hint added in each hook/overload.


8. Leverage Browser Caching
As and when you can, cache the content in user browser because the next load for a user will be a lot faster.

Add the following code to the .htaccess file to enable browser caching for static content


9. Limit Spider Activity
You can limit spider activity on member pages or help pages to make sure your server doesn’t waste bandwidth to Google.

Note: Do this if you want the site members to name not to be used in Google to find your site or in short if you are using it as a social networking site.

Add the following lines to your robots.txt file

Code:
User-agent: *
Disallow: /members/*

10. Compress Output (GZIP)
Always compress the output to save extra bandwidth. Add the following code to .htaccess file.

Code:
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
</IfModule>
 
Thread starter Similar threads Forum Replies Date
Sonia Tutorials 0
Sonia Tutorials 0

Similar threads


Top

Dear User!

We found that you are blocking the display of ads on our site.

Please add it to the exception list or disable AdBlock.

The advertises that you'll see aren't intrusive they just help us to keep the community alive

If you don't want to see those ads just buy an upgrade.

Thank you for understanding!

Rogue

Rogue Purchase

User upgrade! at

🔥 Upgrade Now
Baba2

Baba2 Purchase

User upgrade! at

🔥 Upgrade Now

Escanor25 Purchase

User upgrade! at

🔥 Upgrade Now