• Check if a specific Request is a prefetch request created by using

    or .

    Parameters

    Returns boolean

    export async function loader({ request }: LoaderFunctionArgs) {
    let data = await getData(request)
    let headers = new Headers()
    if (isPrefetch(request)) {
    headers.set("Cache-Control", "private, max-age=5, smax-age=0")
    }
    return json(data, { headers })
    }
  • Check if a specific Request is a prefetch request created by using

    or .

    Parameters

    Returns boolean

    export async function loader({ request }: LoaderFunctionArgs) {
    let data = await getData(request)
    let headers = new Headers()
    if (isPrefetch(request)) {
    headers.set("Cache-Control", "private, max-age=5, smax-age=0")
    }
    return json(data, { headers })
    }