0.0
No commit activity in last 3 years
No release in over 3 years
Extends Rack::File and Rack::Static with gzip pre-compression optimization support. Also supports gzipped file extraction for clients which do not support gzip encoding.'
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 1.5.0
 Project Readme

Rack::GzipFile, Rack::GzipStatic

English | 日本語

Rack::GzipFile has the same function as Rack::File with the following two extensions.

  • Supports gzip pre-compressed file optimization (like Nginx gzip_static module). If a client support gzip-encoding, it searchs .gz file first from the same directory and returns a gzipped body.
  • Furthermore, if .gz file exists and a client does not support gzip, it inflates .gz file and returns as a body (non-gzipped original file is no longer needed).

Rack::GzipStatic is also identical to Rack::Static with the extensions shown above.

Install

gem install rack-gzip-file

Usage

Upper-compatible to Rack::File and Rack::Static.

require 'rack/gzip_file'
run Rack::GzipFile.new('public')
require 'rack/gzip_static
use Rack::GzipStatic, urls: [''], root: 'public', index: 'index.html'
run lambda {|env|}

License

MIT (See LICENSE.txt)