GithubHelp home page GithubHelp logo

Comments (3)

75lb avatar 75lb commented on September 27, 2024

hi Kyle.. negligible CPU load on which spec machine? On slower machines with shitty browsers loading big, nasty websites it has a noticeable effect on performance.. generally, sites load faster (by varying degrees) with compression switched off.. i imagine you'd only get a benefit from --compress on terrible network connections.. did you notice otherwise?

anyway, to make --compress the default, run this command:

$ echo '{ "compress": true }' > ~/.local-web-server.json

with this config in your home folder, any invocation of ws will include the compress option.. run ws --config at any point to print what config is in effect.

local-web-server v2 will be ready soon, it's much better.. if you have any ideas or requests, let me know.

from local-web-server.

KyleAMathews avatar KyleAMathews commented on September 27, 2024

Negligible on my Mac Book Pro w/ Chrome :-)

I definitely see your point that compression is often not appropriate. I guess my angle is I like to replicate production conditions as much as possible while dev-ing and it's a) disconcerting to see network transfer sizes rise so dramatically w/o compression and b) I sometimes simulate poor network conditions w/ Chrome's devtools and having compression enabled for that definitely makes a big difference.

But your ~/.local-web-server.json solution is a perfectly acceptable workaround.

Thanks for the response! Looking forward to v2.

from local-web-server.

75lb avatar 75lb commented on September 27, 2024

thought you might be on a MBP - yes, it will be negligible on the most powerful laptop available ;)

Compression is a definitely a performance win and should be on-as-default in all cases where network is involved.. but when the server and client are both on the same machine (as is typically the case for ws users) it doesn't serve any purpose at all beside introducing a small overhead..

yeah, it's important to test with typical prod-server configs while developing, experimenting with different caching strategies etc.. v2 will help more with that.. just want to finish jsdoc2md v2 first..

from local-web-server.

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.