Error cache flexigrid iOS6 - no refresh data [SOLVED]

Publicado el 07-11-2012

With iOS6 update many WebAPPs using flexigrid have a big trouble. Safari use cache in POST queries. That means if you change some data shown in a flexigrid, it not be updated in a refresh, you should refresh twice!

 

That was a big problem form my applications, and I have been looking some way to fix it.

 

When I have readen thesee posts:

http://arstechnica.com/apple/2012/09/developers-claim-safari-in-ios-6-breaks-web-apps-with-aggressive-caching/

http://stackoverflow.com/questions/12506897/is-safari-on-ios-6-caching-ajax-results

I realized what was happening and I could reach the solution: just edit flexigrid.js and add a cache param in the ajax call:

Edit:

$.ajax({
   type: p.method,
   url: p.url,
   data: param,
   dataType: p.dataType,
  // success: ,
   success: function(data){g.addData(data);},
   error: function(data) { try { if (p.onError) p.onError(data); } catch (e) {} }
 });

adding:

$.ajax({
   type: p.method,
   url: p.url,
   data: param,
   cache: false,
   dataType: p.dataType,
  // success: ,
   success: function(data){g.addData(data);},
   error: function(data) { try { if (p.onError) p.onError(data); } catch (e) {} }
 });

UPDATE:

If it doesn't work tray adding a new an variable on time param to the ajax call:

auxD = new Date();
var param = [
  { name : 'page', value : p.newp }
  ,{ name : 'rp', value : p.rp }
  ,{ name : 'sortname', value : p.sortname}
  ,{ name : 'sortorder', value : p.sortorder }
  ,{ name : 'query', value : p.query}
  ,{ name : 'qtype', value : p.qtype}
  ,{ name : 'nocache', value: auxD.getHours()*10000+auxD.getMinutes()*100+auxD.getSeconds()}
];

 

 

UPDATE 2:

http://proogresa.es/blog/52-algoritmos/203-ios6-safari-error-with-cache-problem-fixed.html

Categorías: Algoritmos

Comparte este artículo

Comenta este artículo

Web Project & Online Marketing Proogresa S.L. © 2020 | Condiciones Legales | Política de Privacidad | Política de Cookies | Mapa del Sitio | Compliance


¡Seguimos trabajando! Nos hemos adaptado a las medidas excepcionales que estamos viviendo y seguimos trabajando al 100% de nuestras capacidades. Más info.