<commit_before># node-staticize

Router staticize for express

SUPPORTS:

- [expressjs](https://github.com/strongloop/express)


- [sailsjs](https://github.com/balderdashy/sails)

USE:

- [memory](https://github.com/ptarjan/node-cache)


- [redis](https://github.com/NodeRedis/node_redis)

Cache:

- api result
- api view/render

# Install

``` shell
npm install node-staticize
```

# Example

To use staticize in you module, simply import it:

``` javascript
var Staticize = require('staticize');
```

And set it (use memory or redis or others):

``` javascript
var staticize = new Staticize({
  cache : {
    adapter: 'redis',
    options: {
      host: '127.0.0.1',
      port: '6379'
    }
  },
  routes: {
    '/cache2s'    : 2,
    'get /cache3s': 3
  }
});
```

Then you can create a middleware:

``` javascript
staticize.cacheMiddleware() // set cache seconds, default 0 to skip
```

Use it:<commit_msg>📝update doc<commit_after># node-staticize

Router staticize for express

SUPPORTS:

- [expressjs](https://github.com/strongloop/express)


- [sailsjs](https://github.com/balderdashy/sails)

USE:

- [memory](https://github.com/ptarjan/node-cache)


- [redis](https://github.com/NodeRedis/node_redis)

Cache:

- api result
- api view/render

# Install

``` shell
npm install node-staticize
```

# Example

To use staticize in you module, simply import it:

``` javascript
var Staticize = require('staticize');
```

And set it (use memory or redis or others):

``` javascript
var staticize = new Staticize({
  cache : {
    adapter: 'redis',
    options: {
      host: '127.0.0.1',
      port: '6379'
    }
  },
  routes: {
    '/cache2s'    : 2,  // default GET method
    'get /cache3s': 3,
    'post /cache3s': 3,
    'get /foo/:bar': 5, // match /foo/whatever
  }
});
```

Then you can create a middleware:

``` javascript
staticize.cacheMiddleware() // set cache seconds, default 0 to skip
```

Use it:
{'fraction_non_alphanumeric': 0.1577023498694517, 'fraction_numerical': 0.01723237597911227, 'mean_word_length': 3.2295805739514347, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6042584', 'n_tokens_mistral': 733, 'n_tokens_neox': 685, 'n_words': 173}