Skip to content

103 Early Hints

Lets the server send some headers (like links to CSS or JS) before the main response is ready, so the browser can start preloading resources in advance.

Use this to optimize load times. While your server is busy gathering data for the main response, you can fire off a 103 Early Hints to tell the browser ‘Start downloading these CSS & JS files while you wait for my actual response’.

import { HttpCode, get } from 'shokupan';
export const getResource = get('/resource', () => {
return { message: 'Early Hints' };
}).pipe(HttpCode(103));