1

I have a small problem with my newest web application. I am using HighCharts/HighStock to display a variety of graphs. These graphs are filled with data from JSON files, which differ due to the user selecting certain data. This makes the JavaScript static, but the data not. When using HighStocks, I have noticed that the browser (Chrome) caches the script... I understand why caching would be useful but I need to disable this. Could someone help me with this problem?

I have found a solution which works for me! At top of all the JavaScripts I have added the following piece of code:

$(document).ready(function() {
    $.ajaxSetup({ cache: false });
});
Anna Jeanine
  • 3,234
  • 8
  • 33
  • 58

1 Answers1

0

According to How to control web page caching, across all browsers? make sure you return the following headers with your JSON files.

Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
Community
  • 1
  • 1
BetaRide
  • 14,756
  • 26
  • 84
  • 153