From 64f06ec2b8e29eefb605f3f563764cbe9fbe0cc5 Mon Sep 17 00:00:00 2001 From: Xiao Gui <xgui3783@gmail.com> Date: Tue, 13 Jun 2023 10:21:54 +0200 Subject: [PATCH] maint: add cache to favicon fix: do not show point assignment on a face --- deploy/app.js | 5 ++++- .../point-assignment/point-assignment.component.ts | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/deploy/app.js b/deploy/app.js index 6fa78cb8a..f4b3dcd07 100644 --- a/deploy/app.js +++ b/deploy/app.js @@ -17,7 +17,7 @@ app.use('/quickstart', require('./quickstart')) const hash = string => crypto.createHash('sha256').update(string).digest('hex') -app.use((req, _, next) => { +app.use((req, resp, next) => { if (/main\.bundle\.js$/.test(req.originalUrl)){ const xForwardedFor = req.headers['x-forwarded-for'] const ip = req.socket.remoteAddress @@ -28,6 +28,9 @@ app.use((req, _, next) => { ip: hash(ip) }) } + if (/favicon/.test(req.originalUrl)) { + resp.setHeader(`Cache-Control`, `public, max-age=604800, immutable`) + } next() }) diff --git a/src/atlasComponents/sapiViews/volumes/point-assignment/point-assignment.component.ts b/src/atlasComponents/sapiViews/volumes/point-assignment/point-assignment.component.ts index a28f5691c..64b0ebdb1 100644 --- a/src/atlasComponents/sapiViews/volumes/point-assignment/point-assignment.component.ts +++ b/src/atlasComponents/sapiViews/volumes/point-assignment/point-assignment.component.ts @@ -6,7 +6,7 @@ import { SAPI, EXPECTED_SIIBRA_API_VERSION } from 'src/atlasComponents/sapi/sapi import { SxplrParcellation, SxplrRegion, SxplrTemplate } from 'src/atlasComponents/sapi/sxplrTypes'; import { translateV3Entities } from 'src/atlasComponents/sapi/translateV3'; import { PathReturn } from 'src/atlasComponents/sapi/typeV3'; -import { TSandsPoint } from 'src/util/types'; +import { TFace, TSandsPoint } from 'src/util/types'; import { TZipFileConfig } from "src/zipFilesOutput/type" import { environment } from "src/environments/environment" @@ -33,7 +33,11 @@ export class PointAssignmentComponent implements OnDestroy { #point = new BehaviorSubject<TSandsPoint>(null) @Input() - set point(val: TSandsPoint) { + set point(val: TSandsPoint|TFace) { + const { '@type': type } = val + if (type === "siibra-explorer/surface/face") { + return + } this.#point.next(val) } -- GitLab