The Emirates Network [TEN]

Search
Home > Computers > Webmaster Resources > Proxy Cache

Stopping A Proxy From Cache Your Pages

The Emirates Internet (EIM) proxy in the UAE (United Arab Emirates) caches webpages that are requested through it, and this can become a problem for webmasters who have content that is continuously being updated. I had a page which was updated each week, but the emirates proxy was displaying a month old version of the webpage, even though I was clicking the reload button in my browser. So below you can find guidelines on means of making sure that the emirates proxy or any proxy doesn't cache your webpages.

To tell a proxy not to cache a webpage can be achieved by using the Cache-Control HTTP header and setting it to 'private'. If it is set to 'no-cache', then the proxy and the user's browser will not cache the page. Because the HTTP/1.0 specifications do not recognize the Cache-Control HTTP header, it is good to also use the Pragma HTTP header to specify that a webpage shouldn't be cached. Below you can find out how to send the HTTP headers either in PHP and ASP, but the code must appear before sending the html portion of a webpage.

PHP
<?php
   header("Cache-Control: private");
   header("Pragma: no-cache");
?>

ASP
<%
   Response.AddHeader "Cache-Control", "private"
   Response.AddHeader "Pragma", "no-cache"
%>

For those who don't use PHP or ASP, they can use the following meta tag to send the same headers.

<meta http-equiv="Cache-Control" content="private">
<meta http-equiv="Pragma" content="no-cache">

If a page is cached in the emirates proxy and you want to refresh it, I have found that the Opera browser can make the emirates proxy refresh its cached file. If you have it installed, simply visit the webpage and the proxy cached webpage should appear. Click the reload button and the new webpage will be display. I have checked, but unfortunately Internet Explorer is unable to refresh the cached file. Opera does the refreshing by sending the HTTP_CACHE_CONTROL HTTP header equal to 'no-cache, max-stale=0' to the proxy.

Get Opera

Services
Auto
Business
Computers
Entertainment
Health
Islam
Kids
UAE Guide
Website Directory
E-Cards
Online Polls

| Tell A Friend | Submit a Site | Link to Us
Advertise with Us | About TEN | Contact Us
© 2003 The Emirates Network [TEN]. All Rights Reserved.