You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

hapi-static-cache

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-static-cache

Static file caching for saving time.

1.0.4
latest
Source
npm
Version published
Weekly downloads
15
1400%
Maintainers
1
Weekly downloads
 
Created
Source

hapi-static-cache

Fast memory based static caching plugin for Hapi.

Queues static file reads into single read operations and stores contents in cache for super fast retrieval.

Install

npm install hapi-static-cache

Usage

The most basic usage is to just use the require method and it will auto register itself and set up your static directory in /static/

server.pack.register(require('hapi-static-cache'), function(error) {
    if (error) {
        throw error;
    }
});

If you don't want to base your static content out of /static/ pass options to the plugin the same as hapi documents.

server.pack.register({
  plugin: require('hapi-static-cache'),
  options: {
      resources: '/public'
  }
}, function(error) {
    if (error) {
        throw error;
    }
});

Keywords

hapi

FAQs

Package last updated on 24 Feb 2015

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