Socket
Book a DemoInstallSign in
Socket

@commonshost/manifest

Package Overview
Dependencies
Maintainers
3
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commonshost/manifest

Manifest for HTTP Server Push

latest
Source
npmnpm
Version
3.0.1
Version published
Maintainers
3
Created
Source

@commonshost/manifest

HTTP Server Push Manifest is a configuration format for web servers, CDNs, and web development tools.

Use the API or CLI tool to generate the manifest from static HTML, JS, and CSS files.

Manifest are supported natively by Commons Host. Manifests can be transpiled to many other servers and CDNs.

[
  {
    get: '/app.html',
    push: '/styles/design.css'
  },
  {
    get: '/styles/design.css',
    push: [
      '/images/logo.svg',
      '/images/banner.jpg',
      {
        url: '/fonts/Oswald-ExtraLight.otf',
        priority: 256
      },
      {
        url: '/ads/banner.png',
        priority: 1
      }
    ]
  }
]

Format

A manifest is a JSON array containing rules. Each rule is a JSON object containing a get and push property. These are the trigger and action respectively.

Trigger get

The pathname (URL) of a request. If this matches, the trigger fires its push action.

Action push

One or more resources to push from server to client. A push action has url and priority properties. The url value is a pathname of a local resource. The priority value is an integer from 1 through 256 and defaults to 16.

Supported Platforms

A manifest is an intermediary format which can be transpiled to the configuration syntax of CDN services or web servers.

CDN services: Commons Host (native), Cloudflare, Fastly, Netlify

Web servers: Apache, H2O, NGINX

Platforms: Node.js

Browsers: All modern web browsers support HTTP Server Push. The manifest is used from the server side.

FAQs

Package last updated on 26 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts