Shoutbox

[help] to clear the http web requests - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [help] to clear the http web requests (/showthread.php?tid=75036)

[help] to clear the http web requests by roflmao456 on 06-03-2007 at 10:09 PM

how do i clear the cache of http web requests? or always download a newer version of the page

it always displays the same content that i'm trying to download :p


RE: [help] to clear the http web requests by Veggie on 06-03-2007 at 10:15 PM

Interop.Call('wininet.dll', 'DeleteUrlCacheEntryW', Url);
change Url to the page you are requesting

or you can append the site with a random variable
http://wesite.com/page.php?123124414


RE: [help] to clear the http web requests by Eljay on 06-03-2007 at 10:16 PM

quote:
Originally posted by roflmao456
how do i clear the cache of http web requests?

it always displays the same content that i'm trying to download :p

You could just add a random number onto the end of the URL, so it's fooled into thinking it's loading a different page to the cached one. e.g:
code:
var URL = "http://example.com/?" + Math.random();

RE: [help] to clear the http web requests by Ezra on 06-03-2007 at 10:18 PM

Simplest way is to use no-caching headers.

There are also some tricks, like using a random get parameter in the url to trick the cache into thinking it's a new url.

quote:
Originally posted by Wikipedia
Alternatively, it is possible to force the XMLHttpRequest object to retrieve the content anyway, as shown in this example.

req.open( "GET", "xmlprovider.php" );
req.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" ); //This line doesn't work.
req.send( null );

Another method is to add a random string on the end of the url in the query:

req.open( "GET", "xmlprovider.php?sid=" + Math.random());

Wikipedia article about XMLHTTP
RE: [help] to clear the http web requests by roflmao456 on 06-03-2007 at 10:28 PM

all your ideas were great and worked (Y)

thanks :)