Attachment Download Acceleration for XenForo

Attachment Download Acceleration for XenForo

Chunked-Attachment-Range-Support-for-XenForo-2.webp


Attachment Download Acceleration with Chunked Attachment Range support for XenForo 2 ensures smoother and more reliable file downloads.

This feature enables attachments to be delivered in chunks through HTTP Range requests, allowing users to resume interrupted downloads and fetch only the parts they need from large files without starting over. It improves compatibility with download managers and significantly enhances the user experience, especially for communities sharing large resources.

The system supports three delivery methods: X-Sendfile (Apache), X-Accel-Redirect (Nginx), and PHP-based Chunked Streaming. Use of X-Sendfile or X-Accel-Redirect requires that the web server is configured with these modules enabled.

To enable this feature, go to:
Admin CP → XenVn Setting → Attachments → Attachment Download Acceleration

Once enabled, the system will automatically handle HTTP Range requests when serving attachments, using efficient chunked streaming to optimize server memory usage during downloads.

If your users have requested download resume support or if you want to enhance large file delivery on your forum, this enhancement will make your XenForo forum more powerful and user friendly.

Configuring Apache with X-Sendfile
Step 1: Install the X-Sendfile Module

On Debian/Ubuntu:
Code:
You must log in to view
(1 lines)

Step 2: Enable the Module
Code:
You must log in to view
(1 lines)

Step 3: Configure Apache Virtual Host
Edit your XenForo site’s Apache configuration (e.g., /etc/apache2/sites-available/000-default.conf):
Code:
You must log in to view
(20 lines)

Restart Apache:
Code:
You must log in to view
(1 lines)

Configuring Nginx with X-Accel-Redirect
Step 1: Define an Internal Alias

Edit your Nginx server block (e.g., /etc/nginx/sites-available/xenforo):
Code:
You must log in to view
(11 lines)

Step 2: Restart Nginx
Code:
You must log in to view
(1 lines)

Step 3: Parameter settings: Nginx Internal Alias Mapping
Goto: Admin CP → XenVn Setting → Attachments → Nginx Internal Alias Mapping
URI prefix -> /protected/
File system path -> /var/www/html/internal_data/
This way, it will instruct Nginx to serve the file from /protected/.

If your server does not support X-Sendfile / X-Accel-Redirect, you can use PHP (Chunked Streaming)

chunked-attachment-range-support-for-xenforo-2-1.webp
 
Last edited:
Back
Top Bottom