Coder Social home page Coder Social logo

Comments (4)

guanzo avatar guanzo commented on June 11, 2024 1

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.

DiegoRBaquero avatar DiegoRBaquero commented on June 11, 2024

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.

gruns avatar gruns commented on June 11, 2024

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.

DiegoRBaquero avatar DiegoRBaquero commented on June 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.