Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:cache:lscwp:configuration:optimize [2018/06/14 19:18]
Lisa Clarke [Generate Critical CSS] added whitelist note
litespeed_wiki:cache:lscwp:configuration:optimize [2020/11/14 15:20] (current)
Lisa Clarke Redirect to new Documentation Site
Line 1: Line 1:
-====== LiteSpeed Cache for WordPress SettingsOptimize ====== +~~REDIRECT>​https://docs.litespeedtech.com/​lscache/lscwp/pageopt/~~
- +
-Optimize and [[litespeed_wiki:​cache:​lscwp:​configuration:​tuning|Tuning]] are two closely-related tabs. Generally-speaking,​ you will find the ON/OFF switches in Optimize, and the customizations that go along with these switches in Tuning. +
- +
-For a detailed explanation of what these tabs do, please see [[litespeed_wiki:​cache:​lscwp:​configuration:​minification|Optimization Through Minification and Combination]] +
- +
-**Please test these options thoroughly before enabling them on your production site!** +
- +
-{{:​litespeed_wiki:​cache:​lscwp:​lscwp-settings-optimize.png?​direct&​800|}} +
-===== CSS Minify ===== +
-//off// +
- +
-Extra white space characters, new line characters, and comments will be stripped from all included CSS files, if this option is enabled. +
- +
-===== Inline CSS Minify ===== +
-//off// +
- +
-Extra white space characters, new line characters, and comments will be stripped from all inline CSS code on the HTML page, if this option is enabled. +
- +
-===== CSS Combine ===== +
-//off// +
- +
-All individual CSS files will be combined into a single CSS file. +
- +
-===== CSS HTTP/2 Push ===== +
-//off// +
- +
-CSS will be sent to the browser before it is requested. +
- +
-===== JS Minify ===== +
-//off// +
- +
-Extra white space characters, new line characters, and comments will be stripped from all JS, if this option is enabled. +
- +
-===== Inline JS Minify ===== +
-//off// +
- +
-Extra white space characters, new line characters, and comments will be stripped from all inline JS code on the HTML page, if this option is enabled. +
- +
-===== JS Combine ===== +
-//off// +
- +
-All individual JS files will be combined into a single JS file. +
- +
-===== JS HTTP/2 Push ===== +
-//off// +
- +
-JS will be sent to the browser before it is requested. +
- +
-===== CSS/JS Cache TTL ===== +
-//​604800//​ +
- +
-The minified and combined files are cached. This setting specifies for how long. The minimum is 3600 seconds, but we recommend 604800. When a ''​Purge All''​ command is issued, the minified and combined CSS/JS are included in that purge. +
- +
-===== HTML Minify ===== +
-//off// +
- +
-Extra white space characters, new line characters, and comments will be stripped from all HTML, if this option is enabled. +
- +
-===== Load CSS Asynchronously ===== +
-//off// +
- +
-Page loading can be delayed while waiting for CSS definitions to load. When you load CSS asynchronously,​ the contents of the page no longer have to wait for CSS to be loaded first. This setting also applies to Google Fonts. +
- +
-If you have critical CSS styles and definitions that must be loaded for above-the-fold content, you can specify it in the **Critical CSS Rules** box. +
- +
-===== Generate Critical CSS ===== +
-//ON// +
- +
-**NOTE**: **Load CSS Asynchronously** must be set to ''​ON''​ for this feature to work. +
- +
-When CSS is set to load asynchronously,​ it can cause some content to be loaded before the browser knows how to display it. For this reason, whenever **Load CSS Asynchronously** is enabled, LSCache figures out what CSS is critical to the current display, and loads that part first. +
- +
-This **Generate Critical CSS in the Background** setting determines whether that calculation is done in the foreground, or in the background. This is ''​ON''​ by default. That means it is a background function, and uses a cron-based queue. When a page is viewed, if there is no critical CSS defined for that page type, a request is added to the queue, and the page continues loading without waiting. +
- +
-This is what you may see when there are pages waiting in the queue: +
-{{:​litespeed_wiki:​cache:​lscwp:​lscwp-settings-optimize2.png?​direct&​800|}} +
- +
-If your cron is disabled (or you are impatient) you can press the **Run Queue Manually** button to hurry the process along. +
- +
-If **Generate Critical CSS in the Background** is set to ''​OFF'',​ then the critical CSS is generated in the foreground, immediately when the page is requested. This means that the visitor must wait for the critical CSS calculation before continuing to view the page. This has the potential to slow down page load. +
- +
-**NOTE**: To use LiteSpeed'​s critical CSS generation service, please whitelist ''​ccss.api.litespeedtech.com''​. +
-===== Load JS Deferred ===== +
-//off// +
- +
-This setting takes all scripts and loads them only after the HTML is finished loading. +
- +
-===== Exclude JQuery ===== +
-//on// +
- +
-This setting excludes JQuery from all of the above optimization measures. It is recommended that this setting remain ''​ON'',​ particularly if you have inline JavaScript. If you are experiencing errors when **JS Combine** is enabled, turning this setting on should eliminate them. +
- +
- +
-===== DNS Prefetch ===== +
- +
-//Empty List// +
- +
-With this setting you may perform DNS resolution for the listed domain(s) before it is requested. By prefetching DNS results, latency can be reduced significantly for your visitors as they click external links, particularly on mobile networks. Domains should be entered one per line in the format ''<​nowiki>//​www.example.com</​nowiki>''​. +
- +
-[[https://​developer.mozilla.org/​en-US/​docs/​Web/​HTTP/​Headers/​X-DNS-Prefetch-Control|Learn more]]. +
- +
-===== Remove Comments ===== +
- +
-//OFF// +
- +
-By default, comments are preserved when JS and CSS are minified, but these comments can take up valuable space. Enable this option to strip comments from minified files and make them more efficient to transmit.+
  • Admin
  • Last modified: 2018/06/14 19:18
  • by Lisa Clarke