Comments (5)
If we gzip the CSV before we put it on S3 and then tell S3 that it's
gzipped they will serve it with the appropriate headers that trigger a
browser to decompress it before showing/downloading it to the user.
from machine.
Unfortunately always serving gzip breaks HTTP; you're not supposed to send it gzip unless the client asks. It only works if the browser expects and supports Content-Encoding: gzip
. curl
and wget
both explicitly don't deal with gzip by default.
I set up a demo of this at http://com.somebits.s3gzip.s3-website-us-west-2.amazonaws.com/gzipped.txt. It loads fine in Chrome. It fails with curl
but works with curl --compressed
. wget
doesn't even have a way to decompress, you have to do wget | gunzip
. That's why I think it's better to explicitly name the file .csv.gz
; the user will know what to do with it.
Lots more detail about this weirdness in S3 on my blog.
from machine.
@migurski mentioned running out of disk in some of his EC2 runs. If we only produce compressed products then we can save a lot of disk while a job is running. A full run of 790 sources wrote 28G to disk. If I tar + gzip the whole directory that gets to 17G, 60%. Not an enormous savings but it can only help. (I suspect it's not more because a lot of the 28G is cached shapefile zips that are already compressed.)
from machine.
We had a discussion in Slack and @migurski, @iandees, and I all agree we should zip the CSV output and serve .zip
files instead of .csv
files. This lets us avoid the whole S3/gzip encoding question. Also allows us to put extra files into the product if we want, maybe a .vrt
file or some other metadata.
from machine.
PR #84 does the thing—one of you want to have a look before I merge?
from machine.
Related Issues (20)
- Charts on dashboard are empty due to missing CORS headers HOT 1
- static URL for latest output per source HOT 2
- Unknown problem HOT 1
- San Mateo shapefiles failing to extract
- Toronto data missing city name HOT 6
- Speed up index page HOT 2
- Italian addresses without street name
- Sample data field names don't match actual data: au/countrywide (maybe others) HOT 2
- Requesting an email list for batch completion notifications HOT 5
- Docker Hub image out of date HOT 1
- Dashboard broken: CORS, also data not updating HOT 2
- /latest/run/{source}.zip URLs don't work for all sources HOT 2
- chain function with esri source fails
- Clean out old data/runs? HOT 14
- Allow requester pays access to the data.openaddresses.io bucket
- support gzip compression
- New attribute function for extracting single value for multivalued fields HOT 6
- Gracefully handle source regressions HOT 3
- Slow queries for results.openaddresses.io HOT 2
- Handle case where pre- and -post directional are same HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from machine.