Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8196677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:33:45+00:00 2026-06-07T05:33:45+00:00

I want to display a static HTML page with expressjs. What’s the fastest way

  • 0

I want to display a static HTML page with expressjs. What’s the fastest way to do so? Currently I have a html file stored in the file system and I’m using res.sendfile(home + "/public/file.xml")

Is sendfile the fastest way to do it or might storing the file in some kind of database be faster?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T05:33:46+00:00Added an answer on June 7, 2026 at 5:33 am

    Storing files in database? Well, some people try to do such evil things. But what is the point? I mean database engine has to read the file from disk as well. Additionally has to do many other things making the loading process longer.

    Now you seem to confuse some things. Sending files is the same thing as sending any other response. At some point you have to send the binary data, so you cannot avoid using res.send (or any other form of it). This is of course if we are talking about Node.js, because you might consider serving files via nginx, which is probably the best static file server there is.

    One last thing: if you still want to serve files via Node.JS, then you may consider caching them in memory. This of course depends on how many and how big files you want to serve. This is as easy as creating global variable which holds the data and sends it whenever there is a request. That’s the only real performance boost you can make with Node.JS.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display one static HTML page in my android emulator.
I have a HTML page that I want to display in a WebBrowser control,
I have made a java swing GUI. Now I want to display a static
I have an HTML page where I want to refresh a lot of images
I want a WYSIWYG html editor to create a static web page. After some
Possible Duplicate: display HTML page the same in Java forms I want to display
If I have a static HTML homepage, is there a way of embedding some
I have created an html file by using render_to_string in a controller and send_data
I want to display the context of a .txt file in an html file.
In my application,I want to display some static files(.html,.htm,.txt) which will be uploaded by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.