From d103273bda4b0be8fcdeb38898e6434c0bdaefd9 Mon Sep 17 00:00:00 2001 From: Eugenio Marzo Date: Sun, 28 Mar 2021 11:35:09 +0200 Subject: [PATCH] fix cache problem for Chrome --- helm-charts/kubeinvaders/Chart.yaml | 4 ++-- helm-charts/kubeinvaders/values.yaml | 2 +- html5/kubeinvaders.js | 18 +++++++----------- nginx/KubeInvaders.conf | 1 - 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/helm-charts/kubeinvaders/Chart.yaml b/helm-charts/kubeinvaders/Chart.yaml index c21415c..202c092 100644 --- a/helm-charts/kubeinvaders/Chart.yaml +++ b/helm-charts/kubeinvaders/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: A Helm chart for KubeInvaders name: kubeinvaders -appVersion: 1.1 -version: 1.1 +appVersion: 1.2 +version: 1.2 home: https://github.com/lucky-sideburn/KubeInvaders sources: diff --git a/helm-charts/kubeinvaders/values.yaml b/helm-charts/kubeinvaders/values.yaml index bb66226..eaba9bf 100644 --- a/helm-charts/kubeinvaders/values.yaml +++ b/helm-charts/kubeinvaders/values.yaml @@ -25,7 +25,7 @@ replicaCount: 1 image: repository: luckysideburn/kubeinvaders - tag: v1.1 + tag: v1.2 pullPolicy: Always nameOverride: "" diff --git a/html5/kubeinvaders.js b/html5/kubeinvaders.js index 794fbe3..663700f 100644 --- a/html5/kubeinvaders.js +++ b/html5/kubeinvaders.js @@ -143,10 +143,10 @@ function getNodes(){ oReq.send(); } -function getKubeItems() { +window.setInterval(function getKubeItems() { getNodes(); getPods(); -} +}, 1000) function keyDownHandler(e) { if(e.key == "Right" || e.key == "ArrowRight") { @@ -320,8 +320,7 @@ function drawSpaceship() { ctx.closePath(); } -function draw() { - +window.setInterval(function draw() { ctx.clearRect(0, 0, canvas.width, canvas.height); drawSpaceship(); @@ -381,7 +380,7 @@ function draw() { ctx.fillText('s => Activate or deactivate shuffle for aliens', 10, 340); ctx.fillText('n => Change namespace', 10, 360); } -} +}, 10) function podExists(podName) { for (i=0; i Math.random() - 0.5) } @@ -443,10 +442,7 @@ function setAliens() { } } } -} +}, 1000) getEndpoint(); -getNamespaces(); -setInterval(draw, 10); -setInterval(getKubeItems, 1000); -setInterval(setAliens, 1000); +getNamespaces(); \ No newline at end of file diff --git a/nginx/KubeInvaders.conf b/nginx/KubeInvaders.conf index cfe5a05..ddee774 100644 --- a/nginx/KubeInvaders.conf +++ b/nginx/KubeInvaders.conf @@ -12,7 +12,6 @@ server { add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range'; try_files $uri $uri/ =404; add_header Last-Modified $date_gmt; - add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; if_modified_since off; expires off; etag off;