Comments (4)
Slack convo with lidel
me
we want nginx to gzip CAR files that contain compressible files like text, and not gzip CAR files that contain already compressed files like images/video/audio.
generally u make this decision based on the mime type, but for CAR files the mime type is always application/vnd.ipld.car
is there some convention to specify the content type of the file inside the CAR file?
lidel
no, adding content type as UnixFS metadata was discussed in the past but never spec'd nor implemented.
right now, the only place where we deal with content-type are HTTP gateways – they will sniff the content type based on magic bytes from the beginning of each file – go-ipfs does this: https://github.com/ipfs/go-ipfs/blob/9bd346e25004df4fd7927ab151097f975fb433c2/core/corehttp/gateway_handler_unixfs_file.go#L46L78
You could do something similar – get first N bytes of the file and make decision based on sniffed content type.
from l1-node.
Per top results in google, it makes sense to compress everything rather than not. Bandwidth is more expensive than CPU and we can later optimize by peeking into and compressing only the ones with actual gains.
from l1-node.
Per top results in google, it makes sense to compress everything rather than not.
link pls 🙂. really curious to compare decomp speeds on slow devices. ie how much page render latency would it add to decomp every image needlessly on slow devices (eg feature phones)
otherwise, https://github.com/ipfs/go-ipfs/blob/9bd346e25004df4fd7927ab151097f975fb433c2/core/corehttp/gateway_handler_unixfs_file.go#L46L78 is the 'right' first approach to determining whether to enable comp or not. which, zooming out sucks: the mimetype(s) should be included in the car file metadata. this is a step backwards; there's a reason mimetypes exist :-/
in the future we could have the l2s, or the SPs, parse the car file and add the appropriate mimetype(s) for use upstream by the l1s and/or l2s
from l1-node.
https://serverfault.com/questions/253074/what-is-the-best-nginx-compression-gzip-level
https://sudonull.com/post/172479-GZip-and-nginx-performance-impact
http://paulbuchheit.blogspot.com/2009/04/make-your-site-faster-and-cheaper-to.html
from l1-node.
Related Issues (20)
- Hardcode Requirements into Code/Container instead of fetching them from a URL at start-up
- Geolocation fix HOT 3
- Geolocation fix HOT 1
- return 410 gone instead of 403 forbidden for blocked cids HOT 1
- [PROD ISSUE] Increased error rate seen from network since 9/11
- Geolocation fix
- Geolocation fix
- Geolocation fix HOT 1
- [METERING] Extract JWT in each request and attach to L1 ingestor log submission HOT 3
- Geolocation fix HOT 1
- Geolocation fix HOT 1
- Egress Increase since 10/2
- once auth ships, reject all non-authorized requests HOT 2
- Geolocation fix HOT 6
- Geolocation fix HOT 1
- Temporarily remove requirement for auth on all requests
- add sentry to collect and report errors
- Geolocation fix
- Geolocation fix HOT 3
- Geolocation fix HOT 1
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 l1-node.