How to optimize your SMF forum website
We will take you through the basic steps you need to take to optimize the performance of your SMF forum without installing additional services. This will improve your website speed, protect your website from some kind of exploitation and penalties related to load issues on your hosting server and help improve your website ranking on search engines.
Further reading:
Basic Simple Machine Forum Guide
Simple Machines Forum Web Hosting
You will find the suggested steps needed to optimize your website below:
By default, version 2.0.xx of the Simple Machines Forum installation comes with easy to optimize settings. In this tutorial we will review few of the SMF optimizations options.
Follow the best techniques for SMF optimization:
Step 1: SMF Caching
Step 2: Disable SMF Calendar
Step 3: Configure Search Method in SMF
Step 4: Disable Recent Posts on Forum Index
Step 5: Change Avatars Upload Folder
Further reading:
Basic Simple Machine Forum Guide
How to optimize your SMF forum website
Simple Machines Forum Web Hosting
Step 1 SMF Caching
In order to perform this we will need to access cPanel. Locate the Software and Services section and click on the Select PHP Version icon. On the following screen we will need to check the apc and click on the Save button in the bottom left part of the page.
In order to enable the SMF caching we should be logged as admin of the application. Once the admin area is accessed we should navigate to Configuration -> Server Settings -> Caching. If you have activated the apc module from the cPanel correctly after accessing the Caching page we will be able to see a Caching section. When we scroll to the bottom of the page we should see the following notice:
SMF has detected that your server has APC installed.
After that from the dropdown menu choose Level 1 caching (Recommended) and click on the Save button in the bottom right corner of the page. You may also choose 'Level 2', 'Level 3' etc
to increase the amount of Caching to do (where Level 3 is the highest).
Step 2 Disable SMF Calendar
We know that the calendar looks fancy but if you do not need this feature for your forum, we recommend to be disabled. The main reason for this recommendation is because on every loaded thread the calendar “looks” for an event. The calendar can be deactivated from Simple Machines Forum admin backend by tweaking some settings: -> Configuration -> Core Features. If the calendar is enabled the on/off button on the right side of the section will be green, press it to make it gray and at the bottom of the page press the Save button.
Step 3 Configure Search Method in SMF
If the Search option is enabled for your forum we recommend to be set a search index. This will increase the disk space usage by your application but it will also improve the loading speed of search queries significantly. The search index can be set from the admin backend of your application -> Forum -> Search -> Search method. In the Search index field first create custom index, set it to moderate sized index and then check the Custom index radio button. After all this options are correctly performed press the Save button on the right bottom of the page.
Step 4 Disable Recent Posts on Forum Index
This feature is recommended to be disabled in order to improve the server performance because the recent post feature is a resource consuming process. This feature compiles the list of recent post and as many more posts, members and groups there is the more resource consuming process this will be. Access your admin account of your SMF application -> Configuration -> Current Theme -> Theme Options and Preferences -> Number of recent posts do display on board index field should be set to 0(zero) to disable this feature. After the field is set to 0, click the Save button on the right bottom of the page.
Step 5 Change Avatars Upload Folder
This will decrease the overall load of the server which is generated by your forum. The SMF application recognizes the avatars uploaded in the default folder as an attachments this cause every loading of an avatar image to invoke the index.php file. If we move the images in a separate folder the SMF will handle them as regular images. In order to perform this optimization we will need to access the admin backend -> Forum -> Attachments and Avatars -> Avatar Settings -> Uploadable avatars section. In the Uploadable Avatars section we can see the following fields:
Upload avatars to... – from this dropdown menu we should choose the “Specific directory…” option
Upload directory – we should put the full path to the new avatar directory. For example:
/home/user/public_html/forum/avatars-new –
Creating new avatar directory
You can create the new folder for avatars via your cPanel -> File Manager -> New Folder. If you are not familiar with the service, we recommend reviewing our File Manager tutorial.
Upload URL – this value should be the URL to the new folder we have just created. For example: hxxxp://example.com/forum/avatars-new
In order to complete this optimization do not forget to press the Save button at the right bottom corner of the page.
Change Avatar Directory in SMF
Existing avatars
If your members have already uploaded avatars they can be moved in the new folder via FTP. We recommend reviewing our FTP tutorial for more details on how to use it.
6. Optimize Your Website Database
The last step from this optimization is to update the database. In order to execute a MySQL query we should access cPanel -> phpMyAdmin and select the database that is assigned with the SMF application. After the database is selected we will go to the SQL tab and paste the following MySQL query:
UPDATE `smf_attachments` SET `attachment_type` = '1' WHERE `smf_attachments`.`ID_MEMBER` != 0
If you have performed these tasks, you have conducted the basic steps to optimize your Simple Machine Forum website