|
1 year" ExpiresByType image/gif "access plus 1 month" ExpiresByType image/png "access plus 1 month" ExpiresByType image/jpg "access plus 1 month" ExpiresByType image/jpeg "access plus 1 month" </IfModule> Using UglifyJS and UglifyCSS Some of you probably know what UglifyJS and CSS are. As a precaution, I will only add that these are extensive tools that are used for compressing, parsing and generally modeling JS and CSS scripts.
They are available as Node.js modules. So installing them globally is quite simple. Just enter in the command console: $ npm install -g uglify-js, and then: $ uglifyjs ?help. If you are only interested in Phone Number List local installation, enter the following in the project directory: $ cd /path/to/your/symfony/project $ npm install uglify-js –prefix app/Resources The installation of UglifyCSS is similar. Full installation and use of UglifyJS and UglifyCSS can be found in this post.
Only blocking CSS and JS resources Blocking rendering scripts can be done in two ways. The first, relatively simple one, is to nest the script at the very end of the code before closing the </body> tag. The second, slightly more sophisticated way is to use asynchronous loading (async or defer parameter). The first parameter causes scripts to be loaded without blocking HTML parsing, without maintaining the order of execution. The defer parameter, however, maintains this order.
|
|