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 8797361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:50:24+00:00 2026-06-13T23:50:24+00:00

Similar to this post need to send a large 30MB JSON file to the

  • 0

Similar to this post need to send a large 30MB JSON file to the browser, which compresses to 3MB. (yes, yes, it’s big and intensive to decompress, but better to serve it once as a static file than as, say, 150 separate AJAX calls to a REST API, and a bit of upfront load time is okay here).

Also like the original post, it’s a static file, so can compress it ahead of time (so the server doesn’t need to compress it on each request). Further, can serve it from the public directory on the server, which in Node.js / Express.js I have marked as static:

app.use(express.static(__dirname + "/public"));

One commenter replied:

“It is also possible to precompress your JSON and then just tell Apache to serve the files with the appropriate headers to avoid having to recompress all the time.”

Question 1: How might I do that in Node/Express, i.e. tell Node to tell the browser the file is in gzip format, so that the browser automatically uncompresses it?

Another answer remarks “…but do check that the browser supports compression “, which raises another question?

Question 2: Do ~most~ modern browsers have the ability to decompress content? Or am I better off just including a javascript library for decompression, get the data via Ajax as a binary text, and always decompress it in my own code rather than browser’s native utility?

(For my purpose, it’s okay to exclude some old browsers, e.g. dropping IE6 would be okay, dropping support for IE9 would not)

  • 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-13T23:50:25+00:00Added an answer on June 13, 2026 at 11:50 pm

    The browser should automatically decompress the server response, if there is a Content-Encoding header.

    With node.js, you would serve the already compressed file with the header:

    Content-Encoding: gzip
    

    I.E:

    res.setHeader( "Content-Encoding", "gzip" );
    

    Modern browsers support gzip, for older browsers, check http://www.schroepl.net/projekte/mod_gzip/browser.htm

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

Sidebar

Related Questions

That's a question really similar to this previous post of mine. I need to
I need to send a quite long JSON header through an http post. In
I have a similar problem to this post . I need to display up
I am doing a query that converts rows to columns similar to this post
This post is very similar to my previous one, but the data structures are
I was looking at this post: https://stackoverflow.com/a/2262200 and I have a very similar setup
Currently I am using a post-build event command line similar to this one: xcopy
Django code samples involving post data often shows code similar to this: if request.method
Very similar to this post How can I declare template array as a parameter
Background Similar to this question , I need to determine if an entity in

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.