Sendfile is an IPS plugin that implements server X-Sendfile support into the software suite. Use this to improve server performance on large communities that handle a lot of attachment and/or IDM file downloads.
What is X-Sendfile?
In short, it gives PHP a way to tell your web server to deliver files to the client after proper permission checks and other actions have been performed by IPS. This way, you are not relying on PHP itself to deliver the files to the client.
The reason you don't want PHP to handle file transfers is simple: PHP is really inefficient at it. This is particularly important if you run IPS in a self-hosted environment and your community makes heavy use of attachments or IP.Downloads file submissions.
When you have a lot of users trying to download files concurrently, PHP will rapidly consume your servers available memory pool and, assuming your server makes use PHP-FPM or fastCGI, it will lock up your available PHP processes that are used to serve pages to your other users. This means basic topics and other pages will not load until another users download has completed.
By utilizing X-Sendfile, you are able to pass the workload back off to the web-server. This is immensely more memory efficient, faster, and will keep your PHP processes free. This overall makes IPS significantly more scalable, especially in a self-hosted environment.
Configuration
Assuming you were able to run the test script provided in the plugin description without error, all you will have to do after installing this plugin is enable it and ensure you have the correct web server selected. After that, that's it! The plugin will hook into all local file download requests processed by IPS and pass them off directly to the web server using X-Sendfile.
1. Plugins
Sendfile can be installed and configured directly from the Plugins page in your AdminCP.
2. Settings
To configure Sendfile, just click the pencil icon in the plugins list.
3. Enable
Make sure the "Enable Sendfile" option is toggled
4. Web server selection
Sendfile will attempt to automatically detect the web-server you are using and populate this field accordingly. All you need to do is make sure it is correct and click "Save"! If you are not sure, just ask your hosting provider.
---
That's it! If you have any issues, please let me know here, or submit a bug to my Issues tracker.
☕ Found this useful? Want more free plugins and guides like this one? Show your support by buying me a coffee!
- https://ko-fi.com/makoto_dev