cache-mysql
v0.3.8
Published
Cache mysql queries, it's useful for slow query and it's very easy to use.
Downloads
13
Maintainers
Readme
cache-mysql
Cache mysql queries, it's useful for slow query and it's very easy to use.
Installation
npm install cache-mysql --save
Basic Usage
var mysql = require('mysql');
var cacheMysql = require('cache-mysql');
var connection = mysql.createConnection(yourOpts);
connection = cacheMysql(connection);
Yes, it's so easy.
Advanced Usage
var mysql = require('mysql');
var cacheMysql = require('cache-mysql');
var connection = mysql.createConnection(yourOpts);
connection = cacheMysql(connection, {
expire: '1 day',
cache_dir: __dirname + '/cache'
});