There are many things which you need to do for meeting Google's requirements. However 2 things which impacts to your score most are image optimization and minifying JavaScript + CSS.
In this article, I'll introduce my SEO Tools (written by C#) for solving above matters. You can checkout the source code here: https://github.com/vnheros/c-seotools
The tool uses the following tools:
- C# command line parser for .NET: https://github.com/commandlineparser/commandline (Nuget package: CommandLineParser)
- AjaxMin: http://ajaxmin.codeplex.com (Nuget package: AjaxMin)
- Caesium CommandLineTools: https://github.com/Lymphatus/caesium-clt
- Convert tool of ImageMagick: https://www.imagemagick.org/script/convert.php as recommendation of Google PageSpeed Insights
1. File XML configuration
Below is an example:
BackupSuffix is for copying the original .CSS or . JS file. For example: E:\test\big.js after optimizing ==> E:\test\big_Copy.js (containing original source code) and E:\test\big.js (minified code).
BackupOverwrite = 0 means every time running this tool, it will check and create a backup file with different suffix starting from _Copy1 to _Copy999; = 1 means all times running this tool, it only creates a backup file with suffix _Copy and overwrites it if existing.
DefaultOutPath is for out put folder (containing optimized images) in terms of you don't specify output folder in command.
2. Optimize only files listed in input file
You can use the following command:
SEOTools.exe -i input_fileFor example: input_file is E:\test\files.txt. Output to a folder (e.g. E:\test\output), let use:
SEOTools.exe -i input_file -s subfolder -o output_folderSubfolder is the folder containing image files for compressing, it is used for creating subfolders in backup folder.
3. Optimize all files in input folder (recursively)
You can use the command:
SEOTools.exe -i input_folder -t I -m FOBy default the tool will use Caesium, you can change to use ImageMagick by option -t I. As my experience Caesium gives smaller file size vs. ImageMagick, however ImageMagick runs faster than Caesium. Both also meets Google PageSpeed Insights.
With this tool, you can run after uploading images to your website or modifying CSS file / JavaScript file. Any comment is welcome.
Merry Christmas and Happy New Year!




