How to optimize site performance on Ghost
Optimize Ghost site performance by enabling caching, compressing images, minifying CSS/JS, and using a CDN. Focus on theme optimization and database cleanup for maximum speed improvements.
Prerequisites
- Access to Ghost admin panel
- Basic understanding of web performance concepts
- FTP or hosting control panel access
- Knowledge of image optimization tools
Step-by-Step Instructions
Enable Ghost's Built-in Caching
86400 seconds (24 hours) for optimal performance. Click Save to apply changes.Optimize Images and Media
85% and enable Progressive JPEG.Minify CSS and JavaScript
<style>
/* Inline critical CSS here */
</style>
<script>
// Defer non-critical JS
document.addEventListener('DOMContentLoaded', function() {
// Your optimized JS code
});
</script>Remove unused CSS from your theme by editing theme files in Settings > Design > Advanced > Theme files.Configure CDN Integration
https://your-cdn-domain.com. Enable Force CDN for all assets and Preload critical resources. Click Save settings.Optimize Database Performance
5 recent post revisions. For self-hosted Ghost, run ghost doctor in your terminal to check database health.Enable Lazy Loading and AMP
Optimize Theme Performance
package.json to remove unused dependencies. In default.hbs, add loading="lazy" to image tags and defer attribute to script tags:<img src="{{url}}" loading="lazy" alt="{{alt}}">
<script src="script.js" defer></script>Remove unused CSS classes and optimize Handlebars helpers.Monitor and Test Performance
3 seconds and PageSpeed scores above 90.Common Issues & Troubleshooting
Images not loading after CDN setup
Check CDN URL format in Settings > Advanced. Ensure CDN is properly configured to serve Ghost assets. Clear Ghost cache in Settings > Advanced > Clear cache.
Site slower after enabling caching
Disable problematic cache settings in Settings > Advanced. Check for conflicting plugins or theme issues. Reduce cache duration to 3600 seconds and gradually increase.
AMP pages showing errors
Validate AMP pages using Google's AMP validator. Check theme compatibility in Settings > Design. Remove custom CSS that conflicts with AMP requirements in Code injection.
Theme optimization breaking site layout
Revert to backup theme files in Settings > Design > Advanced. Test changes in development mode first. Check browser console for JavaScript errors and fix code syntax issues.