Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV data fails to update on page refresh in IE8 #195

Closed
craig552uk opened this issue Apr 10, 2013 · 4 comments
Closed

CSV data fails to update on page refresh in IE8 #195

craig552uk opened this issue Apr 10, 2013 · 4 comments

Comments

@craig552uk
Copy link

Using basic code like that below, updates to the csv data file are not reflected in the browser on a page refresh when using IE8.

  var ds = new Miso.Dataset({
    url: 'data.csv',
    delimiter: ','
  });
  ds.fetch({
    success : function(){
      this.each(function(row){
        console.log(row['field']);
      });
    }
  });

Steps to reproduce:

  1. Load page in IE8, note the field values.
  2. Edit the CSV file, changing some of the values.
  3. Refresh the page in IE8.
  4. Note that the data values have not changed.

The problem is not resolved with either a forced refresh or by clearing the browser cache.

Tested with IE8 on WinXP/Win7
Miso Version: miso.ds.deps.ie.min.0.4.0.js

@alexgraul
Copy link
Member

This is odd but I'm not sure it's a dataset issue so much as an IE issue. Ie may however be related to jquery's caching options as per http://stackoverflow.com/questions/1013637/unexpected-caching-of-ajax-results-in-ie8
Can you try adding

$.ajaxSetup({
    cache: false
});

in your code before the dataset init and seeing if that helps?

@craig552uk
Copy link
Author

Yes, I think it is a related problem.
Though that fix didn't work, as dataset doesn't use jQuery.

As a work-around it's possible to append a random element to the request URL, which circumnavigates IE's aggressive caching.

var ds = new Miso.Dataset({
  url: function(){ return 'data.csv?'+ Math.random(); },
  delimiter: ','
});

I'll have a look at building a cache: false option in to dataset if that sounds acceptable?

@alexgraul
Copy link
Member

That's a good point, been a while since I've worked on this! Sounds like a plan to me, will look forward to a pull request!

@iros
Copy link
Member

iros commented Apr 26, 2013

Documented on the wiki under the "How Do I..." page.

Thanks, @iros.

@iros iros closed this as completed Apr 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants