How can I improve performance by reducing asset size and number?
- On-Premise Server + WebMail Installations: Version 7.5.1 > Current Version
- Webmail Only Installations: Version 7.5.1 > Current Version
Performance improvement requirement.
⚠ Atmail 7.5.x
If you are upgrading from 7.5.x please ensure that you have cleared cached minify files from your installation.
To find minify cache path:
$min_cachePath = sys_get_temp_dir(); // usually /tmpOnce cache directory is found, remove all files where the file names starts with "minify_"
Use minification tools in order to reduce asset (CSS, JS) size and number, so that UI performance and maintainability of WebMail, admin and mobile interfaces can be improved.
Minification itself takes care of reducing asset size by compacting them through getting rid of selected characters such as white spaces, line breaks and others.
Concatenation combines multiple files into single ones which are then cached on both backend and frontend sides.
To achieve those tasks and many more, Google Minify library has been brought into the product as of release 7.5.1 and has been installed through composer under:
An endpoint for minifying assets has been created in:
Also, a helper has been created to make minification simple and can be used like the following:
Where these params are mandatory:
For more information, please see:
As described above, once minified & concatenated the assets then combined into a single files which are cached both on backend and frontend sides.
For advanced configuration such as cache lifetime, cache directory and others please see:
- In order to have minificication for CSS files to work properly from the created end point, image's relative uris are rewritten during the process. Absolute uris are not modified.