开发者

Caching in Node Express: How do you whitelist/blacklist views?

Express has 开发者_开发问答a builtin cache mechanism, set up with app.enable('view cache'). But how do you discriminate between views which should be cached and views which should always be served fresh?


I don't know the details, but I think it caches everything. What I mean is that it puts all views inside memory. I don't think you should discriminate between views and should just cache all views. If you don't want this, you could just do the caching yourself by putting them in memory or Redis or something.

But I would advice you to fill issue at Github. I bet TJ will response to that at Github, but does not read this, because at Github he gets email and Stackoverflow he does not.


Views which are mutable should not be cached; only views which are static should be cached. It's up to your application to determine which is which.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜