Skip to content

Commit a624045

Browse files
committed
Merge branch 'jschall-patch-1'
2 parents f75f02a + 1b0d6ed commit a624045

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

Readme.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,15 +105,9 @@ cons.swig('views/page.html', { user: 'tobi' })
105105

106106
## Caching
107107

108-
To enable or disable caching simply pass `{ cache: true/false }`. Engines _may_ use this option to cache things reading the file contents, compiled `Function`s etc. Engines which do _not_ support this may simply ignore it. All engines that consolidate.js implements I/O for will cache the file contents, ideal for production environments.
109-
110-
```js
111-
var cons = require('consolidate');
112-
cons.swig('views/page.html', { cache: false, user: 'tobi' }, function(err, html){
113-
if (err) throw err;
114-
console.log(html);
115-
});
116-
```
108+
To enable caching simply pass `{ cache: true }`. Engines _may_ use this option to cache things reading the file contents, compiled `Function`s etc. Engines which do _not_ support this may simply ignore it. All engines that consolidate.js implements I/O for will cache the file contents, ideal for production environments.
109+
When using consolidate directly: `cons.swig('views/page.html', { user: 'tobi', cache:true }, callback);`
110+
Using Express 3 or higher: `app.locals.cache = true` or set NODE_ENV to 'production' and Express will do this for you.
117111

118112
## Express 3.x example
119113

0 commit comments

Comments
 (0)