- Issue created by @sd123
To squeeze out maximum performance and to give Matomo another advantage over Google Analytics, it would be great to add support for Brotli compression if the module detects support.
I did a manual compression at maximum Brotli compression level and compared it with the matomo.js and matomo.bz files generated in /sites/default/files/matomo/:
Size comparison:
That is about 13% less and it brings the tracking script below the size of the old GA3 script.
Decompression speed comparison:
That is more than 5 times faster!
I am no programmer, but looking at the code I guess a similar entry like the following needs to be added to the code:
if (extension_loaded('zlib') && \Drupal::config('system.performance')->get('js.gzip')) {
\Drupal::service('file_system')->saveData(gzencode($data, (int) 9, FORCE_GZIP), $file_destination . '.gz', FileSystemInterface::EXISTS_REPLACE);
}
Active
1.21
Code