moraexams / website

https://moraexams.org
0 stars 5 forks source link

Elevate Website's Speed with Link Prefetching 🚀 #27

Closed sanjaiyan-dev closed 3 months ago

sanjaiyan-dev commented 3 months ago

This PR leverages prefetching to boost website navigation speed. The rel="prefetch" attribute has been added to all links, allowing the browser to proactively download resources in the background, resulting in a smoother user experience.

Benefits:

Reference: https://web.dev/articles/link-prefetch#improve_navigations_with_relprefetch

netlify[bot] commented 3 months ago

Deploy request for moraexams pending review.

Visit the deploys page to approve it

Name Link
Latest commit f714c22a28c89324f4bc06b5013b7d98fa407069
sahithyandev commented 3 months ago

Is prefetching all links a good idea? I think it's better to use another strategy than just blindedly prefect all links. Otherwise users would have to spend too much bandwidth for pages that they don't visit.

sanjaiyan-dev commented 3 months ago

Is prefetching all links a good idea? I think it's better to use another strategy than just blindedly prefect all links. Otherwise users would have to spend too much bandwidth for pages that they don't visit.

Hi @sahithyandev, I thought prefetching all links was okay since they start to prefetch when the user hovers over them, and there are only two links.

Ref-: https://docs.astro.build/en/guides/prefetch/#prefetch-strategies

sanjaiyan-dev commented 3 months ago

Please note that prefetching is currently limited to internal links, which direct users to pages within the website. External links, such as those to Google Drive, are not subject to prefetching.