Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 9 of 9 total
Thread IE Cache
Mon, Jul 17 2017 6:32 AMPermanent Link

Matthew Jones

I've just tried to do a test using two browsers simultaneously, and found that IE is doing a lot of caching of my requests. In particular, I have a login call, and it is returning a 200 OK from the cache, without ever talking to the server!
The EWB documentation shows the headers:

 Cache-Control: max-age=0
 If-Modified-Since: Thu, 16 Aug 2012 18:35:21 GMT

After some experimentation, it seems there is no automatic control. Anyone done anything in this area? If I turn off the cache in the Chrome debug, it adds
 cache-control:no-cache
as a header. I guess adding that myself every time should work...

--

Matthew Jones
Mon, Jul 17 2017 6:39 AMPermanent Link

Matthew Jones

Matthew Jones wrote:

>  I guess adding that myself every time should work...

Nope! It actually doesn't get into the request.

https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache

implies there is no good fix. Surely this must be something solved by now?

--

Matthew Jones
Mon, Jul 17 2017 7:01 AMPermanent Link

Matthew Jones

Matthew Jones wrote:

> Nope! It actually doesn't get into the request.

<panto>Oh yes it does!</panto>

It appears it is important to actually be putting this on the request you are examining and sending. Seems not all of my code uses the same request...

So, cache is solved...

--

Matthew Jones
Mon, Jul 17 2017 10:16 AMPermanent Link

Mark Brooks

Slikware

Avatar

Excuse the brevity. On a boat. I add a cache-buster to the end of the URL for my GET requests in order to be sure. Has never failed me. I use &cb_ plus a number of seconds.
Mon, Jul 17 2017 10:33 AMPermanent Link

Big Al

>>Mark Brooks wrote:

>>Excuse the brevity. On a boat. I add a cache-buster to the end of the URL for my GET requests in order to be >>sure. Has never failed me. I use &cb_ plus a number of seconds.

Mark,
When you get back on land can you give a bit more info? I think I've been seeing this problem also, but had not narrowed down what happening.

Thanks
Big Al
Mon, Jul 17 2017 12:01 PMPermanent Link

Matthew Jones

Mark Brooks wrote:

> Excuse the brevity. On a boat. I add a cache-buster to the end of the URL for my GET requests in order to be sure. Has never failed me. I use &cb_ plus a number of seconds.

I pondered that, but the web server looks to match parameters, and might cause trouble. Doing it automatically would also be a pain, given I have many URLs to add to, some with and some without existing parameters.

The cache control seems to be working for me anyway.

--

Matthew Jones
Mon, Jul 17 2017 12:03 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Surely this must be something solved by now? >>

Adding:

Cache-Control: no-cache

as a response header on the server side is the correct way to handle this.  This is what EWB does with all database API requests.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Jul 17 2017 12:13 PMPermanent Link

Mark Brooks

Slikware

Avatar

Still on boat, however:

function MCBAddCacheBuster(const AURL: string): string;
var
I: integer;
begin
I := MSecondOf(Now) + (SecondOf(Now) * 1000) + (MinuteOf(Now) * 60 * 1000);
if Pos('?',AURL) <> 0 then
Result := AURL + '&_cb=' + IntToStr(I)
else
Result := AURL + '?_cb=' + IntToStr(I);
end;
Tue, Jul 18 2017 3:46 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> on the server side

Of course! Now to work out how to get my server to do that. C#/.Net has a lot of good "magic", but it also hides a lot therefore.

--

Matthew Jones
Image