smart-static-fs-cachedeprecated

File system cache engine for smart-static.

Usage no npm install needed!

<script type="module">
  import smartStaticFsCache from 'https://cdn.skypack.dev/smart-static-fs-cache';
</script>

README

smart-static-fs-cache

Build Status

File system cache engine for smart-static.

How to Use

Usage: fsCache(cacheDir, options)

Example

var http = require('http');

var smartStatic = require('smart-static');
var fsCache = require('smart-static-fs-cache');

var server = http.createServer(smartStatic(serveDir, {
    cache: fsCache(yourCacheDir, {
        createDirectory: false
    })
));

server.listen(8000);

Remark. It does not make sense to use caching without template engine plug-ins - as only template renderings are cached. See smart-static for available template plug-ins.

Options

There is only one available option for this plug-in.

Name Type Default Description
createDirectory Boolean false Create directory if it does not exist.

License

MIT