The use of X-SENDFILE (Apache) or X-ACCEL (NGINX) reduces the load on the server when delivering the media, as these are then delivered directly via the web server and not via PHP.
First, the required Apache module must be installed:
apt install libapache2-mod-xsendfile
We then add the Apache vHost configuration under /etc/apache2/sites-available as follows:
<IfModule mod_xsendfile.c>
XSendFile on
SetEnv MOD_X_SENDFILE_ENABLED 1
XSendFilePath /var/www/html # Absolute path to the VIMP Installation-Directory (the directory containing web - not web itself)
</IfModule>
Now the Apache only needs to be restarted:
systemctl restart apache2
We first define a new location for NGINX:
location /accl/ {
internal;
alias /var/www/html/; # Absolute path to the VIMP Installation-Directory (the directory containing web - not web itself)
}
We then add an FCGI parameter within the main location, which starts as follows:
location ~ ^/(index|frontend_dev|frontend_cache|backend|backend_dev|
Here we add the following:
fastcgi_param X_ACCEL_AVAILABLE /accl/; # Has to be the name of the location created on the previous step (in this example "/accl/")
And restart NGINX:
systemctl restart nginx
Done - the files are now delivered directly via the web server.