class Lucky::StaticCompressionHandler


Middleware that serves static files that have been pre-compressed. There can be multiple instances and the first in the middleware stack will take precedence. For example, if you want to serve brotli compressed assets for browsers that support it and serve gzip assets for those that don't you would do something like this in your middleware in src/

  # ..."./public", file_ext: "br", content_encoding: "br"),"./public", file_ext: "gz", content_encoding: "gzip"),
  # ...

Included Modules

Defined in:



Instance Method Summary

Instance methods inherited from class Object

blank? : Bool blank?, present? : Bool present?

Constructor Detail

def : String, file_ext : String = "gz", content_encoding : String = "gzip") #

[View source]

Instance Method Detail

def call(context) #

[View source]