1. 首页
  2. 数据库
  3. 其它
  4. Node.js 实现简单的无侵入式缓存框架的方法

Node.js 实现简单的无侵入式缓存框架的方法

上传者: 2021-02-01 06:26:11上传 PDF文件 63KB 热度 11次
前言 python 的flask.ext.cache 通过注解这样对方法返回结果进行缓存: @cache.cached(timeout=300, key_prefix='view_%s', unless=None) def hello(name=None): print 'view hello called' return render_template('hello.html', name=name) 这类实现方式对业务逻辑没有丝毫的侵入性,非常之优雅。 最近在做 Node.js 地项目,然而 js ES 7 之前都不支持注解,目前见到的缓存框架虽然在 API 设计上都很简洁、
下载地址
用户评论