On this page:
current-preload-dependencies
track-preload-dependency!
make-preload-headers
wrap-preload

21 Preloading🔗

 (require koyo/preload) package: koyo-lib

This module provides a middleware and facilities for working with preload headers.

This parameter holds the set of absolute dependency URLs for the current request.

procedure

(track-preload-dependency! dependency)  void?

  dependency : string?
Adds dependency to the current-preload-dependencies.

procedure

(make-preload-headers)  (listof header?)

Converts the current-preload-dependencies into a list of Link headers.

procedure

(wrap-preload handler)  (-> request? any/c ... response?)

  handler : procedure?
Wraps handler so that preload dependencies can be tracked during its execution.