Skip to content

Instantly share code, notes, and snippets.

@lyhcode
Created May 12, 2012 07:59
Show Gist options
  • Save lyhcode/2665123 to your computer and use it in GitHub Desktop.
Save lyhcode/2665123 to your computer and use it in GitHub Desktop.
Express.js + connect-cache
// refer http://www.bishen.org/content/35579925757
var express = require('express')
, ejs = require('ejs')
, routes= require('./routes')
, cache = require('connect-cache');
var app = module.exports = express.createServer(
cache({rules: [
{regex: /.*/, ttl: 21600000},
{regex: /content\/.*/, ttl: 864000000}
]})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment