Select to view content in your preferred language

IE10, IE 11 and Proxy

1472
6
Jump to solution
06-09-2014 04:18 PM
AlexeiB
Deactivated User
I am running a JS application using Server 10.1. I have a couple of services that are secured with a user name and password. I have established a proxy that accesses these services.

My web application is able to add a polygon to a feature class, and then a user is able to, using a template picker, add related points to the initial polygon.

Feature Class: Farm (polygon)
Feature Class: Animals (point)

So I am adding animals to a farm.

Using IE 9, Firefox, and Chrome, after I add an animal I execute queryRelatedRecords on my Farm feature class and my query returns all my related animals, including the one I just added.

However when I use IE 10 or IE 11, I am able to add the animal to the farm but when I execute queryRelatedRecords, I get the initial animal list that I saw when I first opened the map. Again, the animal is added, but if my farm had 2 animals before I added a 3rd, I get 2 animals via the queryRelatedRecords until I close my browser and open it up again.

Has anyone come across anything similar and have an idea how to fix this?

Thank you,

Alex
0 Kudos
1 Solution

Accepted Solutions
AlexeiB
Deactivated User
Thank you all for your suggestions. I solved this yesterday and though I would update my post.

The issue was indeed that the request was being cached. I tried everything on the server and my proxy page to make sure the cache was disabled but to no avail. What solved the problem was the following:

esri.setRequestPreCallback(function (ioArgs) {     if ((ioArgs.url.indexOf("MapServer") > -1) || (ioArgs.url.indexOf("FeatureServer") > -1))          ioArgs.preventCache = true; }


Just placed that before I load my layers and voila. Having inspected the new request being made, there is a cacheBuster parameter added with every request which changes and thus generates a brand new request.

For an issue of such importance I found the solution evasive to find. Hopefully it helps someone else.

View solution in original post

0 Kudos
6 Replies
JustinChmura
Deactivated User
I would try maybe calling .refresh() on the layer itself. Maybe there's some weird thing going on where the layer is not recognizing there's a new feature added to it so it isn't updating the data.
0 Kudos
AlexeiB
Deactivated User
I have done that a few times now with no success. It is almost like my proxy page is caching the initial result and returning that one continuously until I close the browser.

Does anyone have any experience turning the caching off in the proxy page and / or the aspx page? I have tried PRAGMA tags, cache-control tags as well as including the output cache rule in the proxy site itself. I'd like to compare my approach(es) vs other who may have had the same issue.

Thank you,

Alex
0 Kudos
DasaPaddock
Esri Regular Contributor
Are you using the proxy code from here?
https://github.com/Esri/resource-proxy
0 Kudos
AlexeiB
Deactivated User
Are you using the proxy code from here?
https://github.com/Esri/resource-proxy


Yes I am. I have declared my referrer in <ProxyConfig> and also added my <serverUrl> to the server I wish to access. One thing I should note is having used the debugger in IE 10, I see that every time I do a queryRelatedRecords I get back a 304 result which means something along the lines of no content has changed. Is there a way I can add some sort of cacheBuster parameter when doing queryRelatedRecords?

Thank you for your help,

Alex
0 Kudos
JordanBaumgardner
Frequent Contributor
I saw this several times with IE and Silverlight. Nothing I did got that stupid browser to drop that cache - Until - I changed the URL.

I added and arbitrary where clause rnd() = sameRND(). And on the url's I added a &rnd=rnd() paramater.
This tricked IE into thinking it was a different URL and made the call properly.
0 Kudos
AlexeiB
Deactivated User
Thank you all for your suggestions. I solved this yesterday and though I would update my post.

The issue was indeed that the request was being cached. I tried everything on the server and my proxy page to make sure the cache was disabled but to no avail. What solved the problem was the following:

esri.setRequestPreCallback(function (ioArgs) {     if ((ioArgs.url.indexOf("MapServer") > -1) || (ioArgs.url.indexOf("FeatureServer") > -1))          ioArgs.preventCache = true; }


Just placed that before I load my layers and voila. Having inspected the new request being made, there is a cacheBuster parameter added with every request which changes and thus generates a brand new request.

For an issue of such importance I found the solution evasive to find. Hopefully it helps someone else.
0 Kudos