mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxt): store payloads in cache without trailing slash (#19992)
This commit is contained in:
parent
826c054154
commit
b31fd4ad34
@ -5,7 +5,7 @@ import type { H3Event } from 'h3'
|
||||
import { appendHeader, getQuery, writeEarlyHints, readBody, createError } from 'h3'
|
||||
import devalue from '@nuxt/devalue'
|
||||
import destr from 'destr'
|
||||
import { joinURL } from 'ufo'
|
||||
import { joinURL, withoutTrailingSlash } from 'ufo'
|
||||
import { renderToString as _renderToString } from 'vue/server-renderer'
|
||||
import { hash } from 'ohash'
|
||||
|
||||
@ -262,7 +262,7 @@ export default defineRenderHandler(async (event) => {
|
||||
// Hint nitro to prerender payload for this route
|
||||
appendHeader(event, 'x-nitro-prerender', joinURL(url, '_payload.js'))
|
||||
// Use same ssr context to generate payload for this route
|
||||
PAYLOAD_CACHE!.set(url, renderPayloadResponse(ssrContext))
|
||||
PAYLOAD_CACHE!.set(withoutTrailingSlash(url), renderPayloadResponse(ssrContext))
|
||||
}
|
||||
|
||||
// Render meta
|
||||
|
Loading…
Reference in New Issue
Block a user