Created
May 14, 2012 12:45
-
-
Save lyhcode/2693746 to your computer and use it in GitHub Desktop.
Node.js + express + connect-cache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express') | |
, routes = require('./routes') | |
, cache = require('connect-cache'); | |
// all urls contains "cached" will be cached for 1min. e.g. /services/cached/list.json | |
var app = module.exports = express.createServer( | |
cache({rules: [ | |
{regex: /\/cached\/.*/, ttl: 60 * 1000} | |
]}) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment