PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WEBDEV 2024 → Resolving AJAX IE Cache
Resolving AJAX IE Cache
Iniciado por Tony Turner, 13,abr. 2014 13:25 - 2 respuestas
Publicado el 13,abril 2014 - 13:25
Hi

I have lots of AJAX on our site and works in all (well probably most) browsers except IE.

IE7,8,9,10,11 appears to think the data is the same so never does a new AJAX call, you can search on Google AJAX IE cache and you will find lots of solutions like add time stamp on AJAX URL but as we are using WebDev this is not so easy, unless some clever person says do this ....





Now a check box or function in Webdev would have been nice:-

// New Function May be ?
BrowserAjaxNoCache to tell the browser not to cache AJAX calls or WebDev puts a timeStamp on each call.
or
BrowserAddAJAXTimeStamp

I have tried:-

// Fix IE AJAX Cache or Not
IF BrowserType() = BrowserTypeInternetExplorer OR BrowserType() = BrowserTypeUnknown THEN
sNoCache is string=[
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<META http-equiv="cache-control" content="no-cache">
]
MyPage..HTMLHeader = sNoCache
END

I have also tried:-

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" >
and
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" >
and
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11" >

Now this is variable as to whether it works, if tested locally, yes but not when published to the server.

My last attempt is:-

// Fix IE AJAX Cache or Not
IF BrowserType() = BrowserTypeInternetExplorer OR BrowserType() = BrowserTypeUnknown THEN
sNoCache is string=[
<META http-equiv="cache-control" content="no-cache; private; no-store; must-revalidate; max-stale=0; post-check=0; pre-check=0; max-age=0">
]
MyPage..HTMLHeader = sNoCache
END

Which doesn't work.

Any one out there got a simple solution in WebDev?

Thanks

Tony
Miembro registrado
1 mensaje
Publicado el 17,septiembre 2014 - 21:03
Any chance you ever found a solution to this problem?

I have the exact same situation here and I'm running out of ideas to get around it.
Publicado el 18,septiembre 2014 - 13:30
Hi Tony

AFAIK, the working solution is
> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" >

I am using it on my web sites where most things work using ajax.

-BUT- (there is always one), it has to be set in the page properties in
the editor and NOT by code. Why? Because IE accept this directive ONLY
if it finds it early enough in its page intepretation...

Setting it in the page properties adds that line at the BEGINNING of the
header, setting it by code adds it at the END (too late for IE)

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

NEW: WXReplication, your open source replication system is available on
my web site!!!
WXShowroom.com: Show your projects!
More information on http://www.fabriceharari.com


On 4/13/2014 5:25 AM, Tony Turner wrote:
Hi

I have lots of AJAX on our site and works in all (well probably most)
browsers except IE.

IE7,8,9,10,11 appears to think the data is the same so never does a new
AJAX call, you can search on Google AJAX IE cache and you will find lots
of solutions like add time stamp on AJAX URL but as we are using WebDev
this is not so easy, unless some clever person says do this ....






Now a check box or function in Webdev would have been nice:-

// New Function May be ?
BrowserAjaxNoCache to tell the browser not to cache AJAX calls or WebDev
puts a timeStamp on each call.
or
BrowserAddAJAXTimeStamp

I have tried:-

// Fix IE AJAX Cache or Not
IF BrowserType() = BrowserTypeInternetExplorer OR BrowserType() =
BrowserTypeUnknown THEN
sNoCache is string=[
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<META http-equiv="cache-control" content="no-cache">
]
MyPage..HTMLHeader = sNoCache
END

I have also tried:-

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" >
and
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE10" >
and
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE11" >

Now this is variable as to whether it works, if tested locally, yes but
not when published to the server.

My last attempt is:-

// Fix IE AJAX Cache or Not
IF BrowserType() = BrowserTypeInternetExplorer OR BrowserType() =
BrowserTypeUnknown THEN
sNoCache is string=[
<META http-equiv="cache-control" content="no-cache; private;
no-store; must-revalidate; max-stale=0; post-check=0; pre-check=0;
max-age=0">
]
MyPage..HTMLHeader = sNoCache
END

Which doesn't work.

Any one out there got a simple solution in WebDev?

Thanks

Tony