Skip to content
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

Merged
merged 1 commit into from
Mar 2, 2017

Conversation

acburdine
Copy link
Member

refs #7812, closes #7958

  • fixes boolean logic wrt to theme cache value from config
  • disable cache for admin assets in development
  • only add asset hash in production

@@ -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.

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.

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

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.

@kirrg001 kirrg001 self-assigned this Feb 27, 2017
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
@kirrg001 kirrg001 merged commit 144544e into TryGhost:master Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ghost-Admin assets are cached in development mode
4 participants