XsendFile
Overview
The XsendFile module utilizes either X-Sendfile for Apache or X-Accel-Redirect for Nginx when downloading files. It is used for downloadable products when customers start downloading a product. The extension sends X-Sendfile headers for Apache web servers or X-Accel-Redirects for Nginx web servers. X-accel allows for internal redirection to a location determined by a header returned from a backend.
This allows you to handle authentication, logging, or whatever else you please in your backend and then have NGINX handle serving the contents from the redirected location to the end-user, thus freeing up the backend to handle other requests. This feature is commonly known as X-Sendfile. You can find out more information about the XSendfile feature in the Nginx documentation.
Features
- Ability to choose server type from the admin: This feature allows you to choose whether to use X-Sendfile or X-Accel-Redirect for file downloads.
- Header sent automatically when a customer downloads the file of downloadable product: This feature automatically sends the appropriate header to the web server when a customer downloads a file. This can improve file download speeds.
- Ability to specify path for downloaded files outside of Magento folder: This feature allows you to specify a path for downloaded files outside of the Magento folder. This can be useful if you want to store downloaded files in a different location.
- Improved security for file downloads: This module improves security for file downloads by preventing unauthorized access to files.
- Supports Nginx & Apache web servers: This module supports both Nginx and Apache web servers.
Benefits
- Increased customer satisfaction
- Improved website performance
- Reduced hosting costs
Install the X-Sendfile or X-Accel-Redirect module today and improve Magento file downloads!
Magento Compatibility | 2.3.x, 2.4.x |
---|---|
License | GNU General Public License v3.0 (GPL-3.0) |
Composer Package | thesgroup/module-xsendfile |
Automatically Add The Repository
Through an SSH connection, all you have to do is run the following command from your Magento installation directory
composer config repositories.www.sashas.org composer https://www.sashas.org
Manually Add The Repository
The typical Magento 2 installation has repositories section of composer.json like this:
{
"repositories": [
{
"type": "composer",
"url": "https://repo.magento.com/"
}
]
}
You will need to add a repository by appending an object to the repositories object
{
"repositories": {
"0": {
"type": "composer",
"url": "https://repo.magento.com/"
},
"www.sashas.org": {
"type": "composer",
"url": "https://www.sashas.org"
}
},
}
How To Install The Module
Once the repository is added to the composer.json file, you can now install the packages that are available through it.
For example, let’s say you want to install the thesgroup/module-xsendfile module through composer. Run the command below to install it:
composer require thesgroup/module-xsendfile