Skip to content

deco-cx/prefetch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prefetch for Fresh

Fresh plugin for prefetching pages powered by Google's quicklink.

According to Google's web development guidelines, prefetching leads to faster load times, resulting in higher conversion rates and better user experiences. Prefetching can be implemented using the link tag.

Usage

To use this plugin, just add to your fresh config:

import prefetchPlugin, { Options } from 'https://deno.land/x/prefetch'

const options: Options = {
  throttle: 4 // 4 concurrent requests
  // ...
}

await start(manifest, {
  ...
  plugins: [
    prefetchPlugin(options),
  ],
});

Start your fresh server, access your page. All anchor tags containing a relative href attribute should be prefetched. To make sure it's working, open the Chrome DevTools Network tab and make sure the pages are being prefeetched.

All serializable options accepted by quicklink are also accepted by this plugin.

About

A Fresh plugin for prefetching pages

Resources

Stars

Watchers

Forks

Packages

No packages published