IE & JSON Caching Bug
I came across a weird bug. It seems that IE is the only browser that has a tendency insists on caching JSON results. I created a little api call that returned a list of users “favorites”. I use jQuery to retrieve this list and make updates to my site.
Well apparently IE caches the JSON file, so any changes are not reflected. Firefox and Safari seem to work fine. I tried a number of mime types (as I understand it, the defacto standard is application/json), but the only one that seemed to keep IE from caching it was text/plain. Go figure. And people wonder why developers hate IE so much…
Related posts:
- Django & Djson… er, JSON I must admin this is my first attempt at even...
Related posts brought to you by Yet Another Related Posts Plugin.
September 17, 2009
Tags: cache, IE, jquery, json Posted in: Programming & Internet




23 Responses
no kiddin’!
ie would at least be ‘usable’ if they stayed within one standard… creating a site for ie compliance entails a minimum of 3 standards (v.6,7 & 8)… so it’s like building a site for 6 browsers ( ie x 3 + chrome/safari, netscape/firefox & opera)…
good post… short but well said
A bit frustrating. There are quite a few things you can only do in IE as well, so in the end you find yourself running a few browsers. It’s not ideal but computers have always been like this. There’s always a glitch or a bug somewhere.
I havent tried any hardcore plugin developments or api building just like you. But I was devastated with IE especially when i write CSS codes. I pray to god each time I press the F5 button after I tweak my code so that it looks perfect in IE. But most of the times IE makes it look distorted and I feel disgusted. I never hard any issues with firefox, opera or even chrome as a matter of fact. I can easily understand your feelings because there is more technicality like jquery being used and hence more frustration. But its good that you used the JavaScript Object Notation. I have heard it being the standard practice nowadays. Anyways I never allow IE to test my patience
Regards,
Mack McMillan
I find myself upgrading each version of IE when it comes out hoping it will be better than the last, still prefer Firefox.
For me, Firefox is way more better than any IE. I’ve been using it for years already and had no issues about it so far.
Firefox is way faster and better than IE. Although i have one issue of firefox, it’s when you used it, the launching of firefox is long to wait.
Maybe IE must realize that they should need to upgrade mroe and become faster than ever.
I’ve been using Firefox and everything seemed much more better than IE. Seemingly, in my point of view Firefox do better most especially when I open another tab, in comparison to IE it would open another window which is quiet disturbing.
When you pick up the travel bug, on the page of the cache where you found the bug you should see an “Inventory” on the right side of the page, and your bug should be listed. Simply click on the link for the bug and you will be taken to the bug’s page. In the upper right corner of the page is a drop-down menu. Click on the “Found it? Log it!” link and fill in the required information.
i think this bug has been fixed in IE9, moreover if you still find problem i would advise you to directly to got microsoft website and download KB19192 patch for this bug, this will surely help you.
All versions or just the latest version?
I’m done with IE. I was mindlessly loyal to it for years until I couldn’t take its bugginess and sluggishness any longer. Happy with Firefox now. If Firefox ever gets as bad as IE, I’ll switch to google chrome.
Before everyone starts hating IE for the wrong reasons, lets clarify a few things. This is about to sound pretty nerdy but since your blog title is “Nerdy Dork” I think I’m allowed to say it… Following the HTTP RFC, which states that “GET” requests are cache-able, IE is not at fault. Now that’s assuming you were using the “GET” method. The last time I checked jQuery’s documentation, if you have not specified the method, defaults to using “GET” method to make a request. Someone should call me out on that.
To stop caching, trying using a “POST” method. If you’re using jQuery 1.2 or later, there’s even an option that you can use to turn off caching.
http://docs.jquery.com/Ajax/jQuery.ajax#options
If for whatever reason you cannot use “POST” and has to stick to a “GET”, then try using a cache busting method For instance, sticking a unique param at the end of your request url but be sure to use a param that won’t affect the outcome of JSON returned, other than it not being cached of course.
hao. I went back and verified, it is a POST method. Why would IE cache every mimetype except text/plain?
Anyway, back to the IE hating!
Hey Dustin, that’s is unfortunate… I hope you’ve found a solution you like to solve this problem.
In regards to the IE mime-type issues, its been an on-going problem (like the CSS problems another commenter had mentioned above) for years. I think even IE 8 still has problems with mime-types…
Anyway, I did forget to mention that I am an IE hater myself…
So yes, back to hating IE.
for caching this can be easily overridden by adding a query string and a timestamps to your arc attribute of the script. still i like IE over other browsers may be because i am a .net developer. I tried firefox, i cant say anything bad about firefox. but whenever IE comes with new versions. it simply force me to quit firefox to back to IE. again it is me it differs person to person.
I was so loyal to IE for years but this autumn I have switched to FireFox and I have never looked back. More fool Microsoft.
Yeah I have no idea why I didn’t make the switch to FF sooner. I wonder if the Chrome will start picking up more traction…
-Jack
Jack, I’m sure Chrome will gain traction now that they have support for extensions. That is what keeps people on Firefox. Everyone has their favorite extensions. What keeps me on Firefox? Adblock Plus, Last Pass, & Firebug mainly.
I must admit that I am one of IE haters.Its more of love-hate relationship with IE since there are applications I can’t seem to run properly in Firefox.Thanks for the heads up on this one.Kudos!
Too bad IE will always have a huge share of the market since practically all PCs come with IE as the main browser and most people don’t even have a clue about the other browsers out there and how to run them.
I hate IE and stopped using it for few years now. I guess it will still be a major browser because it is owned by Microsoft.
I also hate IE! Just giving me lot of aches browsing. So i stick with firefox
Leave a Reply