antirez / antirez/dump1090

Fix browser caching

Ouverte
#106 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C
Étoiles
2.9k
Forks
1.4k
Métriques de merge des PR
Aucune PR mergée en 30 j

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.