javascript - Node.js expressjs fastest way to store and display a html page -


i want display static html page expressjs. what's fastest way so? have html file stored in file system , i'm using res.sendfile(home + "/public/file.xml")

is sendfile fastest way or might storing file in kind of database faster?

thanks

storing files in database? well, people try such evil things. point? mean database engine has read file disk well. additionally has many other things making loading process longer.

now seem confuse things. sending files same thing sending other response. at point have send binary data, cannot avoid using res.send (or other form of it). of course if talking node.js, because might consider serving files via nginx, best static file server there is.

one last thing: if still want serve files via node.js, may consider caching them in memory. of course depends on how many , how big files want serve. easy creating global variable holds data , sends whenever there request. that's real performance boost can make node.js.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -