Elderjs / elderjs

Elder.js is an opinionated static site generator and web framework for Svelte built with SEO in mind.
https://elderguide.com/tech/elderjs/
MIT License
2.11k stars 52 forks source link

Prefetching #246

Open janat08 opened 2 years ago

janat08 commented 2 years ago

If prefetching is supported, is there a programmatic way to begin prefetching pages? Frameworks like gatsbyjs demand that you delineate links that shouldn't be prefetched.

eight04 commented 2 years ago

Elderjs does generate prefetch directives for component scripts/data. https://github.com/Elderjs/elderjs/blob/023336a7a61cb60d9549f1cc5ff4d1922334ed5a/src/partialHydration/hydrateComponents.ts#L215 It doesn't prefetch links on the page.

janat08 commented 2 years ago

Server side frameworks would use something like turbolinks to begin prefetching on hover, is there something like it from SPA or elderjs? Elderjs isn't spa right, so prefetching links as if they're server served would work?

eight04 commented 1 year ago

Elderjs is not a SPA framework. It generates static site, which only includes static page, scripts, and styles.

So yes, prefetching links should work if the browser/server cache is configured correctly.