Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CSV Exporter] Add compression option for csv exports #351

Open
Juiced66 opened this issue Jul 5, 2024 · 0 comments
Open

[CSV Exporter] Add compression option for csv exports #351

Juiced66 opened this issue Jul 5, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Juiced66
Copy link
Contributor

Juiced66 commented Jul 5, 2024

Description:

Add support for gzip compression when exporting data to CSV.

Tasks:

  • Update sendExport method to enable gzip compression.
  • Update exportMeasures function to accept compress parameter.
  • Configure response headers for compressed output.

Example Code:

if (compress) {
  const gzipStream = createGzip();
  stream.pipe(gzipStream);
  stream = gzipStream;
}

request.response.configure({
  headers: {
    "Content-Disposition": `attachment; filename="${fileName}.gz"`,
    "Content-Type": "application/gzip",
});

Pros:

  • Reduces file size, saving bandwidth.
  • Faster downloads for users.

Cons:

  • Increases CPU usage for compression.
  • Requires [ client-side handling / user action ] for decompression.
@Juiced66 Juiced66 added the enhancement New feature or request label Jul 5, 2024
@Juiced66 Juiced66 self-assigned this Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant