From e7f52a1fc477bf2a660ac6199b19d266e984031c Mon Sep 17 00:00:00 2001 From: Pavel Tatarskiy Date: Tue, 27 Aug 2024 22:11:08 +0300 Subject: [PATCH] fix log caching and init event timing --- assets/src/js/app/embed/check.js | 1 + assets/src/js/app/embed/index.js | 1 - services/web/job/log.go | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/src/js/app/embed/check.js b/assets/src/js/app/embed/check.js index 7cef751..04fe21f 100644 --- a/assets/src/js/app/embed/check.js +++ b/assets/src/js/app/embed/check.js @@ -10,6 +10,7 @@ if (c) { window.addEventListener('click', async () => { initEmbed(data); }, { once: true }); + message.send('inited'); } function initPlaceholder(data) { diff --git a/assets/src/js/app/embed/index.js b/assets/src/js/app/embed/index.js index 981774b..5eff0ef 100644 --- a/assets/src/js/app/embed/index.js +++ b/assets/src/js/app/embed/index.js @@ -38,5 +38,4 @@ window.addEventListener('load', async () => { document.body.style.backgroundImage = 'url(' + window._embedSettings.poster + ')'; document.body.style.backgroundSize = 'cover'; } - message.send('inited'); }); \ No newline at end of file diff --git a/services/web/job/log.go b/services/web/job/log.go index 532dd9e..e3b1080 100644 --- a/services/web/job/log.go +++ b/services/web/job/log.go @@ -15,7 +15,7 @@ func (s *Handler) log(c *gin.Context) { } c.Header("Content-Type", "text/event-stream") - c.Header("Cache-Control", "no-cache") + c.Header("Cache-Control", "no-cache,no-store,no-transform") c.Header("Connection", "keep-alive") c.Header("Access-Control-Allow-Origin", "*")