summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--derelict.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/derelict.js b/derelict.js
index 65acb7c..0329729 100644
--- a/derelict.js
+++ b/derelict.js
@@ -2,6 +2,7 @@ import * as THREE from 'https://unpkg.com/three@0.126.1/build/three.module.js'
import { OrbitControls } from 'https://unpkg.com/three@0.126.1/examples/jsm/controls/OrbitControls.js'
import { CSS2DRenderer, CSS2DObject } from 'https://unpkg.com/three@0.126.1/examples/jsm/renderers/CSS2DRenderer.js'
+const ESI = "https://esi.evetech.net/latest"
const SCALE = 10000
class SkirmishGrid {
@@ -58,7 +59,7 @@ class Wreck {
this.killmail = killmail
this.domElement.className = 'wreck'
const shipTypeId = this.killmail.victim.ship_type_id
- fetch(`https://esi.evetech.net/latest/universe/types/${shipTypeId}/?datasource=tranquility`) // TODO: Cache it.
+ fetch(`${ESI}/universe/types/${shipTypeId}/?datasource=tranquility`, {cache: "force-cache"})
.then(response => response.json())
.then(typeId => this.domElement.dataset.label = typeId.name)
this.domElement.appendChild(iconElement)
@@ -144,7 +145,7 @@ function init() {
fetch(url.searchParams.get("related") + ".json")
.then(response => response.json())
.then(killmails => {
- const url = km => `https://esi.evetech.net/latest/killmails/${km.id}/${km.hash}/?datasource=tranquility`
+ const url = km => `${ESI}/killmails/${km.id}/${km.hash}/?datasource=tranquility`
const retrieve = km => fetch(url(km)).then(response => response.json())
return Promise.all(killmails.map(retrieve))
})