mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-03 03:55:26 +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'),
|
var crypto = require('crypto'),
|
||||||
express = require('express'),
|
express = require('express'),
|
||||||
hbs = require('express-hbs'),
|
hbs = require('express-hbs'),
|
||||||
|
compress = require('compression'),
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
uuid = require('node-uuid'),
|
uuid = require('node-uuid'),
|
||||||
Polyglot = require('node-polyglot'),
|
Polyglot = require('node-polyglot'),
|
||||||
@ -216,6 +217,11 @@ function init(server) {
|
|||||||
// return the correct mime type for woff filess
|
// return the correct mime type for woff filess
|
||||||
express['static'].mime.define({'application/font-woff': ['woff']});
|
express['static'].mime.define({'application/font-woff': ['woff']});
|
||||||
|
|
||||||
|
// enabled gzip compression by default
|
||||||
|
if (config().server.compress !== false) {
|
||||||
|
server.use(compress());
|
||||||
|
}
|
||||||
|
|
||||||
// ## View engine
|
// ## View engine
|
||||||
// set the view engine
|
// set the view engine
|
||||||
server.set('view engine', 'hbs');
|
server.set('view engine', 'hbs');
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
"bookshelf": "0.6.8",
|
"bookshelf": "0.6.8",
|
||||||
"busboy": "0.0.12",
|
"busboy": "0.0.12",
|
||||||
"colors": "0.6.2",
|
"colors": "0.6.2",
|
||||||
|
"compression": "^1.0.2",
|
||||||
"connect-slashes": "1.2.0",
|
"connect-slashes": "1.2.0",
|
||||||
"downsize": "0.0.5",
|
"downsize": "0.0.5",
|
||||||
"express": "3.4.6",
|
"express": "3.4.6",
|
||||||
|
Loading…
Reference in New Issue
Block a user