Skip to content

codeandfury/hapi-static-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;
    }
});

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published