开发者

equivalent of .net output cache in node.js?

New to node coming over from asp.net so was curious about the best modules/frameworks to implement caching in node.js. I would like to cache some expensive db queries so looking for an easy way to cache db results or entire http page output to memory.

In .net it would be using either httpcache or page output caching. Is there an equivalent in the node world?

Should I just set up a local memcached or redis server to a开发者_运维知识库ccomplish this?


If you are using express then there is a settings option for enabling view cache, also since express is built on top of connect you can try to look at connect-cache module. For caching static stuff you can take a look at node-static for example. Caching database queries in memcached or redis may be highly dependent on your data structure, but I would probably choose redis since it supports more advanced data structures which may be handy.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜