Serving static files in Express - is it caching?

There is nothing in the ExpressJS documentation about how files are uploaded.

My question is: when I request a static file, is the file loaded with every request? Or is it somehow cached? If so, how?

+3
source share
3 answers

Express will not automatically cache static content. To do this, we need to use the https://www.npmjs.com/package/cache-control middleware. More details here ( http://blog.modulus.io/nodejs-and-express-static-content ) which helps

+5
source

, ?

, . OS' (, , ) , , , .

, , , , , () ( , ).

Node , , Express, , , .

+2

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


All Articles