From ed8b17e7771cc4e12d2269b72c4d400c96bfdde7 Mon Sep 17 00:00:00 2001 From: Comfy Org PR Bot Date: Sat, 18 Oct 2025 17:48:44 +0900 Subject: [PATCH] [backport rh-test] [perf] disable cache-busting param on cloud (#6119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of #6105 to `rh-test` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6119-backport-rh-test-perf-disable-cache-busting-param-on-cloud-2906d73d3650810b988ecd084b9f86bf) by [Unito](https://www.unito.io) Co-authored-by: Christian Byrne --- .../extensions/vueNodes/widgets/utils/audioUtils.ts | 7 ++----- src/scripts/app.ts | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/renderer/extensions/vueNodes/widgets/utils/audioUtils.ts b/src/renderer/extensions/vueNodes/widgets/utils/audioUtils.ts index 35e0c4482..12e7fdf4f 100644 --- a/src/renderer/extensions/vueNodes/widgets/utils/audioUtils.ts +++ b/src/renderer/extensions/vueNodes/widgets/utils/audioUtils.ts @@ -1,5 +1,6 @@ import type { ResultItemType } from '@/schemas/apiSchema' import { api } from '@/scripts/api' +import { app } from '@/scripts/app' /** * Format time in MM:SS format @@ -23,10 +24,6 @@ export function getAudioUrlFromPath( return api.apiURL(getResourceURL(subfolder, filename, type)) } -function getRandParam() { - return '&rand=' + Math.random() -} - export function getResourceURL( subfolder: string, filename: string, @@ -36,7 +33,7 @@ export function getResourceURL( 'filename=' + encodeURIComponent(filename), 'type=' + type, 'subfolder=' + subfolder, - getRandParam().substring(1) + app.getRandParam().substring(1) ].join('&') return `/view?${params}` diff --git a/src/scripts/app.ts b/src/scripts/app.ts index 63687853c..7d9c400e9 100644 --- a/src/scripts/app.ts +++ b/src/scripts/app.ts @@ -16,6 +16,7 @@ import { } from '@/lib/litegraph/src/litegraph' import type { Vector2 } from '@/lib/litegraph/src/litegraph' import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets' +import { isCloud } from '@/platform/distribution/types' import { useSettingStore } from '@/platform/settings/settingStore' import { useToastStore } from '@/platform/updates/common/toastStore' import { useWorkflowService } from '@/platform/workflow/core/services/workflowService' @@ -336,6 +337,7 @@ export class ComfyApp { } getRandParam() { + if (isCloud) return '' return '&rand=' + Math.random() }