@oresoftware/express.fs.cache
Semver-oriented TypeScript library skeleton.
$ cnpm install @oresoftware/express.fs.cache 
SYNC missed versions from official npm registry.

@oresoftware/express.fs.cache

Use Express middleware to cache and serve static assets

Installation: npm install @oresoftware/express.fs.cache


import express = require('express');
import fsCache from '@oresoftware/express.fs.cache';


app.use('/public', fsCache(path.join(__dirname, 'public')));
app.use('/public', express.static(path.join(__dirname, 'public')));


If the files are in the cache, they will get served by the cache. Given the above code, we would cache all .js, .html, .css files in the public directory. The cached files would be served from an in-memory cache.

If for some reason, a file is not in the cache, then the regular express static middleware would pick up where we left off.

This middleware never calls next(err), only next().

Current Tags

  • 0.0.109                                ...           latest (2 years ago)

9 Versions

  • 0.0.109                                ...           2 years ago
  • 0.0.108                                ...           2 years ago
  • 0.0.107                                ...           2 years ago
  • 0.0.106                                ...           2 years ago
  • 0.0.105                                ...           2 years ago
  • 0.0.104                                ...           2 years ago
  • 0.0.103                                ...           2 years ago
  • 0.0.102                                ...           2 years ago
  • 0.0.101                                ...           2 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 2
Dependencies (6)
Dev Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |