Fix browser caching
Open
- Dominant language
- C
- Stars
- 2.9k
- Forks
- 1.4k
- PR merge metrics
- No merged PRs in 30d
Description
I see a potential caching issue whereby the browser may hang on to previously loaded json for a couple of minutes (depending on the browser). Easily fixed by referencing the .json file with an arbitrary value to negate the caching:
So, change:
```
function fetchData() {
$.getJSON('/data.json', function(data) {
var stillhere = {}
```
to:
```
function fetchData() {
var time = new Date().getTime();
$.getJSON('/data.json?' + time, function(data) {
var stillhere = {}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.