From a performance only view, which would be the best way to block 30 IP addresses?
A) .htaccess file
or
B) PHP code in the file
If you are administrator of your server, I would use none of those, and would ban the IPs at the firewall level -- this way, nor Apache nor Apache+PHP will have to work.
If you're not admin ; well, .htaccess
means only Apache, and no PHP to load/compile/execute ; I'm guessing Apache alone (i.e. .htaccess
) should require less resources than Apache+PHP.
Another way of seing things is maintenance : if you need to add/delete IPs addresses from that list, what would the easiest way be ?
(In that case, I would generally bet for some PHP code...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With