Asset Optimization
A plugin that allows you to mass apply optimizations to your DatoCMS assets.
This is a Community Plugin! Learn how create your own plugin, or copy and
remix existing ones in our documentation
DatoCMS Asset Optimization Plugin
A plugin that allows you to mass apply optimizations to your DatoCMS assets, significantly reducing image file sizes while maintaining visual quality.

Overview
The DatoCMS Asset Optimization Plugin leverages Imgix's powerful image processing capabilities to optimize your media library assets. It helps you:
- Reduce image file sizes without sacrificing quality
- Apply batch optimization to multiple assets
- Configure quality levels based on asset sizes
- Convert images to modern formats like AVIF or WebP
- Track optimization progress with detailed logs
- View statistics on storage savings
Installation
- Log in to your DatoCMS project
- Go to Settings > Plugins
- Search for "Asset Optimization"
- Click "Install"
- Configure the plugin settings as desired
Important: Use Sandbox Environments First
⚠️ STRONGLY RECOMMENDED: Always test this plugin in a sandbox environment before using it in production.
This plugin permanently replaces your original assets and they cannot be recovered. To ensure optimal results:
- Create a sandbox environment in your DatoCMS project
- Test the plugin with various optimization settings
- Fine-tune thresholds and quality settings to your liking
- Verify the optimized assets meet your quality standards
- Once satisfied with the results, promote your changes to production
This approach allows you to safely experiment with different optimization parameters without risking your production assets.
Usage
- After installation, navigate to the plugin in your DatoCMS dashboard
- Configure the optimization settings according to your needs
- Click "Start Optimization" to begin the process
- Watch the progress as the plugin processes your assets
- View the results including statistics on size savings
Asset Filtering & Optimization
- Size-Based Filtering: Only process assets above a certain size threshold
- Intelligent Optimization: Apply different optimization strategies based on asset size categories
- Format Conversion: Convert images to modern formats like AVIF for better compression
- Dimension Resizing: Automatically resize oversized images while maintaining aspect ratio
Website Performance Optimization
- Reduce page load times by decreasing image payload sizes
- Improve Core Web Vitals scores with optimized images
- Enhance mobile experience with appropriately sized images
Storage Cost Reduction
- Minimize storage usage in your DatoCMS media library
- Reduce CDN bandwidth consumption
- Lower operating costs while maintaining quality
Batch Processing
- Mass-update existing media libraries with optimized assets
- Apply consistent optimization settings across your entire asset collection
- Save time compared to manual optimization workflows
Development
Prerequisites
- Node.js (v14+)
- npm or yarn
- DatoCMS account with developer access
Local Development
- Clone the repository
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Configure a local DatoCMS plugin in your project settings pointing to your local server
Building for Production
The built files will be in the dist
directory, ready for deployment.
Support
If you encounter any issues or have questions about the plugin, please open an issue on GitHub.
License
MIT