Skip to content

Commit ed8b17e

Browse files
[backport rh-test] [perf] disable cache-busting param on cloud (#6119)
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 <[email protected]>
1 parent 32e6cfa commit ed8b17e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/renderer/extensions/vueNodes/widgets/utils/audioUtils.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { ResultItemType } from '@/schemas/apiSchema'
22
import { api } from '@/scripts/api'
3+
import { app } from '@/scripts/app'
34

45
/**
56
* Format time in MM:SS format
@@ -23,10 +24,6 @@ export function getAudioUrlFromPath(
2324
return api.apiURL(getResourceURL(subfolder, filename, type))
2425
}
2526

26-
function getRandParam() {
27-
return '&rand=' + Math.random()
28-
}
29-
3027
export function getResourceURL(
3128
subfolder: string,
3229
filename: string,
@@ -36,7 +33,7 @@ export function getResourceURL(
3633
'filename=' + encodeURIComponent(filename),
3734
'type=' + type,
3835
'subfolder=' + subfolder,
39-
getRandParam().substring(1)
36+
app.getRandParam().substring(1)
4037
].join('&')
4138

4239
return `/view?${params}`

src/scripts/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
} from '@/lib/litegraph/src/litegraph'
1717
import type { Vector2 } from '@/lib/litegraph/src/litegraph'
1818
import type { IBaseWidget } from '@/lib/litegraph/src/types/widgets'
19+
import { isCloud } from '@/platform/distribution/types'
1920
import { useSettingStore } from '@/platform/settings/settingStore'
2021
import { useToastStore } from '@/platform/updates/common/toastStore'
2122
import { useWorkflowService } from '@/platform/workflow/core/services/workflowService'
@@ -336,6 +337,7 @@ export class ComfyApp {
336337
}
337338

338339
getRandParam() {
340+
if (isCloud) return ''
339341
return '&rand=' + Math.random()
340342
}
341343

0 commit comments

Comments
 (0)