Avoid Prefetching

Avoid Prefetching

Avoid Prefetching
Mozilla and Google’s prefetching functions are a nice addition to browser technology in many ways. The main two problems with the prefetching idea are that it messes with log files and it means every link on a page could potentially be followed despite the consequences.

To avoid this we can use following code

if ((isset($_SERVER[’HTTP_X_MOZ’])) && ($_SERVER[’HTTP_X_MOZ’] == ‘prefetch’)) {
header(’HTTP/1.0 403 Forbidden’);
echo ‘403: Forbidden

Prefetching not allowed here.’;
die();
}

Leave a Reply

You must be logged in to post a comment.


All material @ copyrighted by chrisranjana.com. If you want to link to this article you are welcome to do so. Unauthorized publication is strictly prohibited. This developer tutorial website contains articles by Php programmers , Software developers, Mysql programmers and asp c# programmers. This website also contains ajax tutorials and advanced mysql sql stored procedures and functions tutorials and sample codes.