mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
automatically insert Link rel="preload" headers
This commit is contained in:
parent
0f75fc30b9
commit
7bbfc37df6
3 changed files with 12 additions and 1 deletions
|
@ -212,7 +212,8 @@ ConfigManager.prototype.set = function (config) {
|
||||||
},
|
},
|
||||||
deprecatedItems: ['updateCheck', 'mail.fromaddress'],
|
deprecatedItems: ['updateCheck', 'mail.fromaddress'],
|
||||||
// create a hash for cache busting assets
|
// create a hash for cache busting assets
|
||||||
assetHash: assetHash
|
assetHash: assetHash,
|
||||||
|
preloadHeaders: this._config.preloadHeaders || false
|
||||||
});
|
});
|
||||||
|
|
||||||
// Also pass config object to
|
// Also pass config object to
|
||||||
|
|
|
@ -25,6 +25,7 @@ var bodyParser = require('body-parser'),
|
||||||
themeHandler = require('./theme-handler'),
|
themeHandler = require('./theme-handler'),
|
||||||
uncapitalise = require('./uncapitalise'),
|
uncapitalise = require('./uncapitalise'),
|
||||||
cors = require('./cors'),
|
cors = require('./cors'),
|
||||||
|
netjet = require('netjet'),
|
||||||
|
|
||||||
ClientPasswordStrategy = require('passport-oauth2-client-password').Strategy,
|
ClientPasswordStrategy = require('passport-oauth2-client-password').Strategy,
|
||||||
BearerStrategy = require('passport-http-bearer').Strategy,
|
BearerStrategy = require('passport-http-bearer').Strategy,
|
||||||
|
@ -70,6 +71,14 @@ setupMiddleware = function setupMiddleware(blogApp, adminApp) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Preload link headers
|
||||||
|
if (config.preloadHeaders) {
|
||||||
|
blogApp.use(netjet({
|
||||||
|
cache: {
|
||||||
|
max: config.preloadHeaders
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
// Favicon
|
// Favicon
|
||||||
blogApp.use(serveSharedFile('favicon.ico', 'image/x-icon', utils.ONE_DAY_S));
|
blogApp.use(serveSharedFile('favicon.ico', 'image/x-icon', utils.ONE_DAY_S));
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
"moment": "2.13.0",
|
"moment": "2.13.0",
|
||||||
"morgan": "1.7.0",
|
"morgan": "1.7.0",
|
||||||
"multer": "1.1.0",
|
"multer": "1.1.0",
|
||||||
|
"netjet": "1.1.0",
|
||||||
"node-uuid": "1.4.7",
|
"node-uuid": "1.4.7",
|
||||||
"nodemailer": "0.7.1",
|
"nodemailer": "0.7.1",
|
||||||
"oauth2orize": "1.2.2",
|
"oauth2orize": "1.2.2",
|
||||||
|
|
Loading…
Add table
Reference in a new issue