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
Next revision Both sides next revision
litespeed_wiki:cache:lscwp:configuration:optimize [2018/06/13 20:17]
Lisa Clarke [Generate Critical CSS] new setting
litespeed_wiki:cache:lscwp:configuration:optimize [2018/07/06 13:38]
Eric Leu [Generate Critical CSS]
Line 7: Line 7:
 **Please test these options thoroughly before enabling them on your production site!** **Please test these options thoroughly before enabling them on your production site!**
  
-{{:​litespeed_wiki:​cache:​lscwp:​lscwp-settings-optimize.png?​direct&​800|}}+{{:​litespeed_wiki:​cache:​lscwp:​lscwp-settings-optimize.png?​direct&​799|}}
 ===== CSS Minify ===== ===== CSS Minify =====
-//off//+//OFF//
  
 Extra white space characters, new line characters, and comments will be stripped from all included CSS files, if this option is enabled. 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 ===== ===== Inline CSS Minify =====
-//off//+//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. 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 ===== ===== CSS Combine =====
-//off//+//OFF//
  
 All individual CSS files will be combined into a single CSS file. All individual CSS files will be combined into a single CSS file.
  
 ===== CSS HTTP/2 Push ===== ===== CSS HTTP/2 Push =====
-//off//+//OFF//
  
 CSS will be sent to the browser before it is requested. CSS will be sent to the browser before it is requested.
  
 ===== JS Minify ===== ===== JS Minify =====
-//off//+//OFF//
  
 Extra white space characters, new line characters, and comments will be stripped from all JS, if this option is enabled. Extra white space characters, new line characters, and comments will be stripped from all JS, if this option is enabled.
  
 ===== Inline JS Minify ===== ===== Inline JS Minify =====
-//off//+//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. 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 ===== ===== JS Combine =====
-//off//+//OFF//
  
 All individual JS files will be combined into a single JS file. All individual JS files will be combined into a single JS file.
  
 ===== JS HTTP/2 Push ===== ===== JS HTTP/2 Push =====
-//off//+//OFF//
  
 JS will be sent to the browser before it is requested. JS will be sent to the browser before it is requested.
Line 54: Line 54:
  
 ===== HTML Minify ===== ===== HTML Minify =====
-//off//+//OFF//
  
 Extra white space characters, new line characters, and comments will be stripped from all HTML, if this option is enabled. Extra white space characters, new line characters, and comments will be stripped from all HTML, if this option is enabled.
  
 ===== Load CSS Asynchronously ===== ===== Load CSS Asynchronously =====
-//off//+//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.+This option defaults ​to ''​OFF''​. When it is OFF, web pages load the normal waywhere the browser loads the CSS from the HTML header before continuing on to display the content in the HTML body.
  
-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.+When you turn this option ON, CSS and HTML will be loaded ​at the same time. The page can load more quickly this way, but it may initially load without formatting. To avoid that problem, you will want to generate ​the Critical CSS and load that first. That is what the next setting is for.
  
 ===== Generate Critical CSS ===== ===== Generate Critical CSS =====
 //ON// //ON//
  
-**NOTE**: ​**Load CSS Asynchronously** ​must be set to ''​ON''​ for this feature ​to work.+This option defaults to ''​ON'',​ but it only works if **Load CSS Asynchronously** ​is also ON. When both settings are enabled, the Critical CSS is generated by LiteSpeed’s remote CCSS server, and then sent back to LSCache.
  
-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 displayand loads that part first.+**Note**: Some themes already generate Critical ​CSS for you. In that caseyou can turn this option OFF.
  
-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.+Once the Critical CSS has been generated, it will be loaded first, and then the rest of the CSS will be loaded asynchronously with the HTML. The page will no longer load without formatting. 
 + 
 +There is one small issue: when your site has not yet had the Critical CSS generated (or after a Purge All), the first visitor to request a page will need to wait for LSCache’s remote CCSS server to generate the styles. That can take a few seconds that the visitor may not be willing to spend. ​This leads us to the next setting. 
 + 
 +**NOTE**: To use LiteSpeed'​s critical CSS generation service, please whitelist ''​ccss.api.litespeedtech.com''​. 
 + 
 +CCSS Procedure: \\ 
 +Visiter ​ <> ​ Client Server ​ <> CCSS Server 
 +  - Step 1. visitor send request to client server 
 +  - Step 2. If there'​s no CCSS on Page server, Client Server will send CCSS request to CCSS Server 
 +  - Step 3. CCSS server will retrieve content+asset from Client Server then generate CCSS 
 +  - Step 4. CCSS Server send generated CCSS back to Client Server 
 +  - Step 5. User start serving content with CCSS from Client Server 
 +===== Generate Critical CSS in the Background ​===== 
 +//ON// 
 + 
 +**NOTE**: **Load CSS Asynchronously** must be set to ''​ON''​ for this feature to work. 
 + 
 +This 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: This is what you may see when there are pages waiting in the queue:
Line 80: Line 98:
  
 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. 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.
 +
 ===== Load JS Deferred ===== ===== Load JS Deferred =====
-//off//+//OFF//
  
 This setting takes all scripts and loads them only after the HTML is finished loading. This setting takes all scripts and loads them only after the HTML is finished loading.
  
 ===== Exclude JQuery ===== ===== Exclude JQuery =====
-//on//+//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. 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.
  • Admin
  • Last modified: 2020/11/14 15:20
  • by Lisa Clarke