apache_get_modules() and Sendfile

#1
We have a woocommerce installation serving downloadable files, and want to serve these files using Sendfile. Woocommerce has this setting available. In the woocommerce code, it checks apache_get_modules() output to see if it contains 'mod_xsendfile'. If not, it falls back to buffering the download through PHP, which is no good for large files like ours.

In our Litespeed CP, "Use sendfile()" IS set to Yes. But still, the output of apache_get_modules() does not contain 'mod_xsendfile' and so Woocommerce falls back to buffering through PHP.

My question is: Should Litespeed normally list mod_xsendfile in apache_get_modules() if the setting is enabled? If so, why isn't it showing up in ours?

https://hoopmama.com/test.php
 

NiteWave

Administrator
#3
#4
I'm not relying on anything here. Woocommerce is a Wordpress plugin used by hundreds of thousands of websites, if not more. Because their code is used in all sorts of environments with varying functionality, they first check to see if sendfile is available, and use it if it is. If it's not available, they fallback to an unsafe redirect method. They have to check to see if it's available, so how do you suggest they update their code to see if the function is available if they cannot rely on apache_get_modules?
 

Pong

Administrator
Staff member
#5
As far as LiteSpeed running as web server, inernal-rediect is available as built-in module. Not like apache, it has to check if the modules exist or not.
 
Top