mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
Merge pull request #2687 from shindakun/expressgzip
Add gzip compression, can be enabled/disabled in config.js
This commit is contained in:
commit
8a4e0e27f2
@ -2,6 +2,7 @@
|
||||
var crypto = require('crypto'),
|
||||
express = require('express'),
|
||||
hbs = require('express-hbs'),
|
||||
compress = require('compression'),
|
||||
fs = require('fs'),
|
||||
uuid = require('node-uuid'),
|
||||
Polyglot = require('node-polyglot'),
|
||||
@ -216,6 +217,11 @@ function init(server) {
|
||||
// return the correct mime type for woff filess
|
||||
express['static'].mime.define({'application/font-woff': ['woff']});
|
||||
|
||||
// enabled gzip compression by default
|
||||
if (config().server.compress !== false) {
|
||||
server.use(compress());
|
||||
}
|
||||
|
||||
// ## View engine
|
||||
// set the view engine
|
||||
server.set('view engine', 'hbs');
|
||||
|
@ -35,6 +35,7 @@
|
||||
"bookshelf": "0.6.8",
|
||||
"busboy": "0.0.12",
|
||||
"colors": "0.6.2",
|
||||
"compression": "^1.0.2",
|
||||
"connect-slashes": "1.2.0",
|
||||
"downsize": "0.0.5",
|
||||
"express": "3.4.6",
|
||||
|
Loading…
Reference in New Issue
Block a user