diff --git a/src/core/session.js b/src/core/session.js index eb0c9880c..cdb978348 100644 --- a/src/core/session.js +++ b/src/core/session.js @@ -110,8 +110,7 @@ export class Session { refresh(url, requestId) { const isRecentRequest = requestId && this.recentRequests.has(requestId) if (!isRecentRequest) { - this.cache.exemptPageFromPreview() - this.visit(url, { action: "replace" }) + this.visit(url, { action: "replace", shouldCacheSnapshot: false }) } } diff --git a/src/tests/functional/page_refresh_tests.js b/src/tests/functional/page_refresh_tests.js index 06a041787..6619ae58e 100644 --- a/src/tests/functional/page_refresh_tests.js +++ b/src/tests/functional/page_refresh_tests.js @@ -33,6 +33,7 @@ test("async page refresh with turbo-stream", async ({ page }) => { await expect(page.locator("#title")).not.toHaveText("Updated") await expect(page.locator("#title")).toHaveText("Page to be refreshed") + expect(await noNextEventNamed(page, "turbo:before-cache")).toBeTruthy() }) test("dispatches a turbo:before-morph-element and turbo:morph-element event for each morphed element", async ({ page }) => {