« Previous entry | Next entry » Browse > Snippets

Skip to comments (6) Disable prefetching of a page
Posted by Erik on Jan 05 2006 @ 14:13  :: 2706 unique visits

This code will disable prefetching of a page. This is usefull in for example a logout page. You don't want accelerators to try and cache that page because it would log people out.

CODE: PHP
if (isset($_SERVER['HTTP_X_MOZ']) && ($_SERVER['HTTP_X_MOZ'] == 'prefetch')) {
  header('HTTP/1.0 403 Forbidden');
  die();
}


Note: normally it is better to only use a POST request for state changes (such as logging out), but this is not always easy to do.

6 comments posted so far
Add your own »

1. On Jan 06 2006 @ 02:13 TheJohnDoe2005 wrote:

Apart from adding the code to your logout pages. I read a similiar article on this code somewhere last year. Issn't this used to block "Google Web Accelerators" from prefetching your pages. It is said to be able to prefetch Admin/Secure pages that are behind authentication as well. I guess you wouldn't just want to add this code to the logout pages but to others as well.

Some Other Ways of preventing it
- Banning IPs Address from 72.14.192.* and 72.14.194.*.
- Make your admin/secure pages SSL.Google Web Accelerator will not prefetch pages using SSL (https). If all of your administration sections use SSL, you have nothing to worry about.

Read More
This news is kinda old...dated back in May 6, 2005
http://news.com.com/Google+speed+bump+draws+scorn/2100-1032_3-5698447.html?tag=nefd.top

2. On Mar 18 2009 @ 09:51 guess wrote:

Weaknesses of world of warcraft gold the client-server model used by World of Warcraft have been wow power levelingexploited in order to crash the cluster of servers that wow8goldmake up a realm. Exploits also include characters being able to instantly Cheapest Wow Goldchange location or teleport. The situation became worse when cheap wow goldtrying to coordinate activities across a number of players or guilds on the same realm.World of Warcraft Lead Producer, stated that new realms would be introduced to relieve warhammer gold the burden on existing ones. Existing realms would be upgraded.

Although the game wow gold follows a similar model to others in the genreand was noted for having wow gold cheap many familiar concepts from roleplaying games, the new approaches gold4powerto reduce pauses between game encounters was well liked. At various times, World of Warcraft players have experienced problems with connecting to and logging in to wow gold for salethe game. Sudden server crashes that would force realms offline also occurred.

4. On Jul 14 2009 @ 04:23 guest wrote:

buy wow gold
my wow power leveling
buy wow gold
good wow power leveling
BUY wow gold
my wow power leveling
CHEAP rs gold
cheap wow power leveling
CHEAPEST lotro gold
MY aion gold
buy wow gold
cheap wow gold
CHEAPEST wow gold

6. On Jan 05 2010 @ 14:28 uggbaileybutton wrote:

bailey button uggs

-ugg boots cheap

ugg boots uk

ugg classic

Add a new comment

Name:
Password: (leave empty for anonymous comment)
 
View formatting tags Comment: