antirez / antirez/dump1090

Fix browser caching

Aperta
#106 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
C
Stelle
2.9k
Fork
1.4k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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 = {}
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.