mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-14 09:52:09 +03:00
Merge pull request #6461 from terinjokes/resource-hints
Add Preload link headers for browsers and CDNs
This commit is contained in:
commit
8808674bbd
@ -212,7 +212,8 @@ ConfigManager.prototype.set = function (config) {
|
||||
},
|
||||
deprecatedItems: ['updateCheck', 'mail.fromaddress'],
|
||||
// create a hash for cache busting assets
|
||||
assetHash: assetHash
|
||||
assetHash: assetHash,
|
||||
preloadHeaders: this._config.preloadHeaders || false
|
||||
});
|
||||
|
||||
// Also pass config object to
|
||||
|
@ -25,6 +25,7 @@ var bodyParser = require('body-parser'),
|
||||
themeHandler = require('./theme-handler'),
|
||||
uncapitalise = require('./uncapitalise'),
|
||||
cors = require('./cors'),
|
||||
netjet = require('netjet'),
|
||||
|
||||
ClientPasswordStrategy = require('passport-oauth2-client-password').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
|
||||
blogApp.use(serveSharedFile('favicon.ico', 'image/x-icon', utils.ONE_DAY_S));
|
||||
|
||||
|
@ -53,6 +53,7 @@
|
||||
"moment": "2.13.0",
|
||||
"morgan": "1.7.0",
|
||||
"multer": "1.1.0",
|
||||
"netjet": "1.1.0",
|
||||
"node-uuid": "1.4.7",
|
||||
"nodemailer": "0.7.1",
|
||||
"oauth2orize": "1.2.2",
|
||||
|
Loading…
Reference in New Issue
Block a user