: Is it a good idea to close the connection on a web hacker / spammer? When I receive a request from a web spammer, such as a GET /wp-login.php, I am thinking of replying with an error (404)
When I receive a request from a web spammer, such as a GET /wp-login.php, I am thinking of replying with an error (404) and closing the HTTP connection immediately with this header:
Connection: close
Is that sensible? It seems to me that this way I am not unlikely to save a connection for a real user...
More posts by @Angela700
2 Comments
Sorted by latest first Latest Oldest Best
I'd recommend:
connection: close
on pages that don't list any other resources that are stored on your server for best performance.
If you can setup a 404 error page without loading any images or special assets, then connection: close is good.
If you need resources to completely load the error page, then connection: close isn't as good since the connection will be closed and another one will be made to load the assets. The closing and opening of a connection increases the time for all resources to be loaded.
This kind of page works with connection: close since no other server resources are required for the page to completely load:
<html>
<head>
<title>Not found</title>
</head>
<body>
Document is not found
</body>
</html>
This one uses resources from the local server, so I wouldn't recommend connection: close on it.
<html>
<head>
<title>Not found</title>
</head>
<body>
<img src="http://www.your-url.com/notfound.jpg">
Document is not found
</body>
</html>
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.