antirez / antirez/dump1090

Fix browser caching

Offen
#106 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C
Sterne
2.9k
Forks
1.4k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.