0

Does anyone have an idea of what's the impact on a website performances when activating Hotlink protection on server.

FYI: hotlink protection disallows other websites on other servers to place an image on their websites that directly refers to my websites. For instance let's say mywebsite.com is including an img file called test.jpg, anotherwebsite.com can NOT place in its pages this line:

<img src="http://mywebsite.com/test.jpg"> 

because mywebsite.com server would recognize that such request is not coming from mywebsite.com and stops the request, therefor anotherwebsite.com woudl display nothing in place of the image.

Actually my websites on which I activated Hotlink protection do not seem to run slower. But I'm just wondering waht's behind it, I suppose Apache web server needs to check for every request for an image and see where such request comes from, so in some way it should decrease performances.

2 Answers 2

0

HTTP requests have a header field called "Referer". This is simply the URL from which you made the current request. This field is sent by browsers on most requests. (There's no referer if you typed a URL in the address bar. And you can configure your browser to not use one, or to fake one...) The hotlink protection you mention simply checks if the referer value is from a different domain than yours, and blocks or redirects the request if that's the case.

So, yes, there's obviously some overhead involved in making this check. But probably not huge. (I honestly can't say) I'd recommend you just pay attention to the server resource usage.

0

Apache is going to check where every request comes from anyway (since it has to be able to send it back), so hotlink protection will definitely not hurt performance.

2
  • Not sure about that. How is hotlink protection implemented? Likely it's using mod_rewrite in a .htaccess, there is definitely some overhead there, even if it is very small.
    – davr
    Feb 23, 2010 at 23:20
  • True, but the performance gain of sending a tiny image (or none at all) vastly outweighs that quick operation.
    – Beep beep
    Feb 24, 2010 at 1:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .