What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Resolved] AJAX cache problem

[Resolved] AJAX cache problem
Author: Message:
Huhu_Manix
Full Member
***

Avatar
Upload me again... *salivate*

Posts: 106
– / Male / –
Joined: Jul 2006
O.P. [Resolved] AJAX cache problem
Hi,

My problem is when I open 2 time the same URL, the script return the same response but the web page has been change.

code:
function getScore(){
    ajax = new ActiveXObject("Microsoft.XMLHTTP");
    ajax.open("GET",url, true);
    ajax.onreadystatechange = getReturn;
    ajax.send(null);
}


Someone know how I can refresh the URL ?

Thx


I found this but i don't try yet :
code:
function getScore(){
    ajax = new ActiveXObject("Microsoft.XMLHTTP");
    ajax.open("GET",url, true);
    ajax.onreadystatechange = getReturn;
    ajax.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
    ajax.send(null);
}

This post was edited on 08-12-2006 at 02:06 AM by Huhu_Manix.
08-12-2006 01:53 AM
Profile E-Mail PM Web Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: [Resolved] AJAX cache problem
Why not just use the DeleteUrlCacheEntryW API?

code:
function ClearCache(sUrl){
    return Interop.Call('wininet.dll', 'DeleteUrlCacheEntryW', sUrl);
}
08-12-2006 02:52 AM
Profile E-Mail PM Find Quote Report
Huhu_Manix
Full Member
***

Avatar
Upload me again... *salivate*

Posts: 106
– / Male / –
Joined: Jul 2006
O.P. RE: [Resolved] AJAX cache problem
Thanks i'll try if no-cache doesn't works.
08-12-2006 12:14 PM
Profile E-Mail PM Web Find Quote Report
alexp2_ad
Scripting Contest Winner
****

Avatar
Who love the chocolate?

Posts: 691
Reputation: 26
36 / Male / –
Joined: May 2004
Status: Away
RE: [Resolved] AJAX cache problem
The common way is usually to add a random number to the url...

Like...

url+='?refresh='+Math.Random;
08-12-2006 01:12 PM
Profile E-Mail PM Find Quote Report
Huhu_Manix
Full Member
***

Avatar
Upload me again... *salivate*

Posts: 106
– / Male / –
Joined: Jul 2006
O.P. RE: [Resolved] AJAX cache problem
I tried with no-cache and the DeleteUrlCacheEntryW, that's works ! (y)
08-13-2006 07:02 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On