Optimization Through Minification and Combination
You can further optimize your WordPress site through the use of minification, combination, and HTTP/2 push, available in LSCWP since v1.2.2. These options are all turned off by default because they may have unexpected results.
Please test thoroughly before enabling minification or combination on your production site!
There are 3 ways the settings on this tab can speed up your site. None of these methods should impact your code's ability to function (but like we said, it can be unpredictable, so please test).
(See LSCWP Configuration for instructions on enabling these features.)
Minify
Minifying removes all unnecessary characters from the code. This speeds things up by reducing the amount of data that needs to be transferred.
Minified CSS and JS will be placed in the code with a line that looks similar to:
''<script data-minified='1' src='http://yoursite.com/min/3fb36.js'></script>''.
Please be aware, if you do not have pretty permalinks enabled (i.e., your site has URLs that look like http://yoursite.com/?p=123
) then your minified code will have a ?
in the URL like so:
''<script data-minified='1' src='http://yoursite.com/?/min/3fb36.js'></script>''
Combine
Combining replaces multiple files with a single file that contains all of the same code that was in the separate ones. This reduces the number of requests made by the browser and potentially removes duplicate code, both of which translate to improvements in speed.
Combined CSS and JS will be placed in the header.
A note about combining JavaScript: if there is JS code defined within the HTML, that JS will not be included in the combined file, and the remaining JS will be combined and placed in a file the footer, so as to avoid any conflicts.
HTTP/2 Push
HTTP/2 Push is a way of sending resources to the browser before the browser asks for them. It increases the speed of your site by reducing the number of requests necessary.