Solved

IE saving server calls?

Posted on 2012-03-16
3
294 Views
Last Modified: 2012-03-16
Hi experts.

This is a weird one.

I have a form wich makes AJAX calls to the server to obtain certain data on an event. I've just found that IE don't actually makes the call when it has done before, this behaviour persist until I close the browser. Firefox and Chrome works fine.

I'll try to explain myself more deeply.

The form has a dropdownlist with a list of workers. When I choose a worker, an AJAX call to the server is cast to obtain certain worker data from the database.

Ok, if I open IE and select a worker from the dropdownlist, the method on the server is called, if I select another one the method is called, BUT if I select again the first worker selected, the server method is not called again. If I select a new one the method is called, but if I select one that has been already selected before the function is not called (I check this with VS debugger, so I can actually detect that the method is being called or not).

Doesn't matter if I get out of the form and browse the rest of the application, even doesn't matter if I logout the application and log on again, while the window is open the method is somewhat recognized and "remembered". And I say remembered because, although the method not being called, the execution of the client code continues and the data received on the first call is loaded ^_^¿

So Firefox and Chrome calls the server method on each single event execution, while IE seems to identify when the call is somewhat "cached", and, instead of calling again the server it directly returns the previous value.

I can see the point in this type of behaviour but also think it has more hindrances than advantages.

Anyone had found similar behaviour and knows if it's avoidable in any way? I've tested it on IE9 and IE10.

Thanks in advance.
0
Comment
Question by:Bardobrave
  • 2
3 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
It's about your browser cache. In your ajax call add the cache parameter :
cache:calée

Or add a new parameter unique at each call :
T: new Date().getTime();
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
cache:false
0
 
LVL 19

Author Closing Comment

by:Bardobrave
Comment Utility
Didn't know about that param. Neither know also that IE default behaviour was to cache calls.
I'd like a consistent cross-browser default behaviour, why Redmond boys has to be always different?
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I had to do a bit of research to find the answer to this question so I thought I'd share my results.  Due to our outdated mainframe systems, we need to downgrade IE9 to IE8 in order to stay compatible.  We also needed to downgrade Java.  In order to…
#Citrix #Internet Explorer #Enterprise Mode #IE 11 #IE 8
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now