SSR data on page load (for SEO) and skeleton loader on client side navigation #9416
Unanswered
bhaskarGyan
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I've been experimenting with using import type { PageServerLoad } from './$types';
import { delay } from '$lib/util';
export const load: PageServerLoad = async ({ isDataRequest }) => {
const slowData = delay(1000).then(() => '🥱');
return {
now: new Date().toLocaleTimeString(),
lazy: {
thing: isDataRequest ? slowData : await slowData
}
};
}; |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is it possible to load the page with data on SSR and show a skeleton loader for client-side navigation (for better perceived performance)?
I checked the new Streaming with promises in the load function (https://kit.svelte.dev/docs/load#streaming-with-promises) but with this, the SEO will be impacted
and without this, for users on a slow network, the app will look unresponsive on CSR
is this something that can be achieved with the current sveltekit?
I know in Nuxt 3.0 there is an option to use Lazy in useFetch which works on Both SSR and CSR
Beta Was this translation helpful? Give feedback.
All reactions