cloudflare / Netjet
Licence: mit
Express middleware to generate preload headers
Stars: ✭ 145
Programming Languages
javascript
184084 projects - #8 most used programming language
netjet
netjet is a Node.js HTTP middleware to automatically insert Preload link headers in HTML responses. These Preload link headers allow for web browsers to initiate early resource fetching before being needed for execution.
Example usage
var express = require('express');
var netjet = require('netjet');
var root = '/path/to/static/folder';
express()
.use(netjet())
.use(express.static(root))
.listen(1337);
Options
-
images, scripts, and styles:
Boolean
:If
true
the corresponding subresources are parsed and added as a Preload Link headers. -
cache:
Object
:Object passed straight to
lru-cache
. It is highly recommended to setcache.max
to an integer. -
attributes:
Array<String>
List of custom attributes that should be added to the Preload Link headers.
License
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].