When using Express with NodeJS - how does cache lookup work?

Express API:

view cache: enables viewing template compilation caching enabled by default

I have 2 questions:

  • In app.js view cache is not explicitly set in the development block, should it be?

  • How does this caching mechanism work? is this similar to memcache?

+5
source share
1 answer

As you can see from the source , cache viewing is enabled by default only in the production environment. If you do not need caching in development (or other environments), you can omit it explicitly.

How image caching works is pretty simple. If enabled, express stores the compiled template in the process memory and displays the cached version. Thus, temporary cache files are not generated and the template is quickly retrieved from memory.

+1
source

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


All Articles