Coder Social home page Coder Social logo

Comments (6)

tkoenig89 avatar tkoenig89 commented on June 14, 2024 1

Just did some reading about brotli, I know now that it's not compatible with gzip :)

So at the moment i could think of two solutions.

  1. Would be to switch the complete module from gzip to brotli with an options flag and serve just one of the filetypes
  2. Might be a little more compelling. Where the pre check of the filesystem for .gz files would additionally look for .bz files and serve .bz if browser supporta it and in all other cases or if there is no .bz file availabe would fallback to gzip.

What would be your use case? As i guess the software should best be designed around a use case. Where my initial use case was to serve compressed files on a system where i don't have the resources for live compression and found gzip to fit my needs.

from express-static-gzip.

tkoenig89 avatar tkoenig89 commented on June 14, 2024 1

I'll try to find time in the next days to add this.

While thinking about addind brotli support i was also thinking about adding some modular extendability to the module. So someone could easily add other compression types by simply providing the name the browser would send and a function that would identify the files on the filesystem. But thats not completly thought through at the moment, so i'll start with the brotli support first.

from express-static-gzip.

tkoenig89 avatar tkoenig89 commented on June 14, 2024

Hey, as this module does only add specifiy headers and serves files already compressed from the file system, i think it should already be working with brotli, as i remember it should be compatible with gzip!? So it should be enough to pre compress files and point express-static-gzip to the folder containing the .gz files. If brotli has some different extension we could add an additional option to serve brotli files instead of gzip ones.

from express-static-gzip.

AilisObrian avatar AilisObrian commented on June 14, 2024

I preferred to use both (.gz + .br) with additional option!
such as ensureBrotliedFiles?

from express-static-gzip.

tkoenig89 avatar tkoenig89 commented on June 14, 2024

Brotli is now available via options.ensureBrotliFiles.
Could not test it in detail at the moment because i did not had the time to setup a https server. Tested my new architecture with gzip and some other compression (which is now also availabe via options.customCompressions).

Still need to do more testing and add some lines to the readme.

from express-static-gzip.

tkoenig89 avatar tkoenig89 commented on June 14, 2024

Module is now updated to 0.2.0 which supports brotli (options.enableBrotli) and custom compressions. How it works is documented in the updated readme.

from express-static-gzip.

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.