The Magento 2 X-Sendfile / X-Accel-Redirect module is a free and open-source module that improves the performance of file downloads in Magento 2. The module works by sending the appropriate header to the web server when a customer downloads a file. This header tells the web server to send the file directly to the client, bypassing the Magento application. This can significantly improve file download speeds.
Features of the Magento 2 X-Sendfile / X-Accel-Redirect module:
- 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.
You have the flexibility to enable or disable X-Sendfile / X-Accel-Redirect headers on your server. When you choose the appropriate server setting, the correct X-Sendfile / X-Accel-Redirect header will be sent to the customer's browser when they attempt to download a product. In addition, you have the option to bypass MIME detection, although this feature is only applicable to file-based downloads. If you are utilizing an NGINX server, you can configure an "Alias path" within your NGINX website configuration file. This path should correspond to the location you have specified for your server.
Benefits of using the Magento 2 X-Sendfile / X-Accel-Redirect module:
- Increased customer satisfaction: Faster file downloads can lead to increased customer satisfaction. - Improved website performance: Faster file downloads can improve website performance by reducing the amount of time that customers have to wait for files to download. - Reduced hosting costs: Faster file downloads can reduce hosting costs by reducing the amount of bandwidth that is used.
How to install the Magento 2 X-Sendfile / X-Accel-Redirect module:
To install the Magento 2 X-Sendfile / X-Accel-Redirect module, follow these steps: - Purchase the module from our website or Magento Marketplace - Install module using composer - Enable the module in the Magento admin panel.
The Magento 2 X-Sendfile / X-Accel-Redirect module is a valuable tool that can improve the performance of file downloads in Magento 2. If you are looking for a way to improve the performance of file downloads on your Magento 2 store, I encourage you to install this module.