-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🎨 fix admin and theme caching issues #8058
Conversation
core/server/admin/app.js
Outdated
@@ -38,7 +38,7 @@ module.exports = function setupAdminApp() { | |||
// @TODO ensure this gets a local 404 error handler | |||
adminApp.use('/assets', serveStatic( | |||
config.get('paths').clientAssets, | |||
{maxAge: utils.ONE_YEAR_MS, fallthrough: false} | |||
{maxAge: (config.get('env') === 'production') ? utils.ONE_YEAR_MS : 0, fallthrough: false} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
core/server/data/meta/asset_url.js
Outdated
if (!config.get('assetHash')) { | ||
config.set('assetHash', utils.generateAssetHash()); | ||
} | ||
if (config.get('env') === 'production') { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
express.static(path.join(config.getContentPath('themes'), req.app.get('activeTheme')), | ||
{maxAge: config.get('caching:theme:maxAge') || utils.ONE_YEAR_MS} | ||
{maxAge: (configMaxAge || configMaxAge === 0) ? configMaxAge : utils.ONE_YEAR_MS} |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
refs TryGhost#7812, closes TryGhost#7958 - fixes boolean logic wrt to theme cache value from config - disable cache for admin assets in development - only add asset hash in production
29b6c2e
to
2511960
Compare
refs #7812, closes #7958