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

api: streaming CSV encodes #1800

Merged
merged 1 commit into from
Jan 22, 2021
Merged

api: streaming CSV encodes #1800

merged 1 commit into from
Jan 22, 2021

Conversation

chappjc
Copy link
Member

@chappjc chappjc commented Jan 22, 2021

The encoding of CSV should not have been entirely in memory, instead
encoding to the http.ResponseWriter one line at a time.

Previously this had a very specific requirement from a public facing
reverse proxy to avoid multiple simultaneous requests to the same
address but it was easy to mess up, so this is the best fix.

For the csv download path, eliminate the cr query and add an optional
"/win" suffix instead to use carriage returns at the end of each line.
This change also reduces the likelihood of server misconfiguration
causing a cache miss.

The encoding of CSV should not have been entirely in memory, instead
encoding to the http.ResponseWriter one line at a time.

Previously this had a very specific requirement from a public facing
reverse proxy to avoid multiple simultaneous requests to the same
address but it was easy to mess up, so this is the best fix.

For the csv download path, eliminate the cr query and add an optional
"/win" suffix instead to use carriage returns at the end of each line.
This change also reduces the likelihood of server misconfiguration
causing a cache miss.
@chappjc chappjc merged commit c3b4c1f into decred:master Jan 22, 2021
@chappjc chappjc deleted the csv-chunked branch January 22, 2021 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant