Express API:
view cache: Enables view template compilation caching, enabled in production by default
I have 2 questions:
In app.js view cache
isn't explicitly set in the development block, should it be?
How does this caching mechanism work; is it analagous to memcache?
Yes, express handles cache-control automatically. It's default value is set to true. And you can just handle it by increasing/decreasing it's maxAge property value.
Express is a node js web application framework that provides broad features for building web and mobile applications. It is used to build a single page, multipage, and hybrid web application. It's a layer built on the top of the Node js that helps manage servers and routes.
As you can see it from the source, view cache is enabled by default only on production
environment. If you don't need caching on development
(or other environments) you can omit setting it explicitly.
How view caching works instead is pretty simple. If enabled, express stores compiled template in process memory and renders the cached version. This way no temporary cache files are generated and the template is retrieved quickly from memory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With