gzip enable Middleware for Vapor
This is a middleware for Vapor framework to enable gzip on Server.
Checkout yourself: http://checkgzipcompression.com/?url=https%3A%2F%2Frescueking.herokuapp.com%2Fscripts%2Fbundle.js
- add
.Package(url: "https://github.com/jhonny-me/GzipMiddleware.git", majorVersion: 0, minor: 1)
to Package.swift => dependencies - in your code
let drop = Droplet(availableMiddleware: ["gzip" :GzipMiddleware()])
- add
"gzip"
to Config/droplet.json => middleware => server
- download or clone the repo
- drop GzipMiddleware.swift and Data+Gzip.swift to your
<Project Dir>/Sources/App/Middlewares
folder - in your code
let drop = Droplet(availableMiddleware: ["gzip" :GzipMiddleware()])
- add
"gzip"
to Config/droplet.json => middleware => server
- use cache first
- cache gzipped data
Thanks support from https://github.com/1024jp/GzipSwift, https://github.com/Zewo/CZlib
MIT