Caching in Node Express: How do you see a whitelist or a blacklist?

Express has a built-in caching mechanism, configured using app.enable ('cache). But how do you distinguish between submissions that should be cached and submissions that should always be kept fresh?

+6
source share
2 answers

I don't know the details, but I think it caches everything. I mean, he puts all kinds in memory. I do not think that you should distinguish between views and should simply cache all representations. If you don't want this, you can just do the caching yourself by putting them into memory or Redis or something like that.

But I would advise you to fill out a question on Github . I bet TJ will answer that on Github, but not read it, because on Github he gets email, but Stackoverflow doesn't.

+5
source

Views that change should not be cached; only views that are static should be cached. It depends on your application to determine what exactly.

0
source

Source: https://habr.com/ru/post/894134/


All Articles