YUKI Hiroshi
null+****@clear*****
Wed Nov 19 18:03:02 JST 2014
YUKI Hiroshi 2014-11-19 18:03:02 +0900 (Wed, 19 Nov 2014) New Revision: df73414978d54c74b04fd753729c9a6ffb1dde5f https://github.com/droonga/droonga-http-server/commit/df73414978d54c74b04fd753729c9a6ffb1dde5f Message: Allow to cache responses only for "search" or Groonga's "select" commands Modified files: bin/droonga-http-server Modified: bin/droonga-http-server (+11 -1) =================================================================== --- bin/droonga-http-server 2014-11-19 16:06:55 +0900 (b740d17) +++ bin/droonga-http-server 2014-11-19 18:03:02 +0900 (d414839) @@ -96,8 +96,18 @@ application.use(session({ application.use(responseTime()); application.use('/', express.static(path.normalize(__dirname + '/../public/groonga-admin'))); if (options.cacheSize > 0) { + //XXX Activate response cache only for some commands. + // In future versions, this restriction should be controlled by + // some information (a part of response message's envelope) + // returned from Droonga Engine. + var cachableEndpoints = [ + '/tables/[^?/]', // REST API, associated to "search" + '/droonga/search', // RAW Droonga command "search" + '/d/select' // Groonga's "select" + ]; var cacheMiddlewareRules = [ - { regex: /^\// } + { regex: new RegExp('^(' + cachableEndpoints.join('|') + ')') } + // { regex: /^\// } ]; if (droonga.Cache) { var cache = new droonga.Cache({ -------------- next part -------------- HTML����������������������������...Download