开发者 |
futtta
denydias |
---|---|
更新时间 | 2020年4月26日 22:11 |
PHP版本: | 4.9 及以上 |
WordPress版本: | 5.3 |
Please sign up at https://criticalcss.com then go to CriticalCSS.com API Keys. This is a premium service, so be sure to read the additional pricing information! At the time of writing (4 May 2018) the price for using CriticalCSS.com is:
£2/month for membership + £5/domain/month.This means the total cost will be £7/month if you use this plugin for one site. If you're not sure yet; with the 30 day free trial, you have nothing to lose!
No; CriticalCSS.com needs the pages for which it has to generate critical css to be publicaly visible to work.
Critical CSS generation is based on a job-queue. For jobs to be added to the queue, your site should have requests and those requests should not be served by a page cache (because in that case WordPress and Autoptimize are not triggered). If you want to speed things up, you can temporarily disable your page cache and click around on your website yourself. Once a job is in the queue it can be executed and sent to criticalcss.com and at one of the next queue runs the critical CSS is retrieved and turned into a rule and it will be used for the next matching request (again for a page not in page cache).
When just installed the plugin will be more active, generating new jobs and for most of those jobs making calls to criticalcss.com. As rules are automatically generated that way, the number of jobs and the number of requests to criticalcss.com will go down significantly. Most importantly; as the bulk of the work is done asynchronously (by the cronned queue processing job), there is no negative impact on the performance of your site, so your visitors will not notice any slowdown.
Autoptimize CriticalCss.com power-up uses scheduled jobs to go over a queue with URL's for which to fetch critical CSS. If there are many items in the queue, the process can take a couple of minutes to finish. If your hosts limits the time scheduled PHP processes can run, you can change the number of requests sent to criticalcss.com (the "request limit") under the Advanced Options (default is 5).
As from AO CCSS 1.7 there is an (advanced) option you can activate to enforce PATH-based rules creation for pages so each page will end up with its own critical CSS.
Yes; create a manual rule (can be both path- and conditional-tag based) and enter none
for critical CSS. If the rule matches, no critical CSS will be added and the full CSS will be inlined instead.
If all jobs remain in "N" (and one is_front_page
job is "P") then wordpress "cron job" that does the queue processing is not getting triggered. To verify you can install the "wp crontrol"-plugin and then under Tools -> Cron Events look for "ao_ccss_queue" and check the "next run" time/ date.
If the "ao_ccss_queue" job is not there, you'll have to de- and re-activate the "autoptimize critical css" plugin to have it re-register the queue-processing task.
If the "ao_ccss_queue" job is there, but has a "next run" date in the past, there is an issue with your site/ hosters WordPress cron and you will have to contact your hoster. Some hosters' info on the topic: WP Engine, BlueHost, HostGator and SiteGround.
This is caused by mod_pagespeed, which -wrongly- assumes the full CSS is not needed any more. You will have to reconfigure mod_pagespeed to prevent this from happening, the solution in this forum-reply might help.
Ensuring the CSS is not render-blocking through this plugin is a first important step to improve rendering performance, but to get a significant better first paint time, you'll need to ensure you have no other render-blocking resources. Some tips:
As of AO CCSS 1.13.0 the plugin binds itself to a domain to avoid unexpected requests from cloned sites. You can either deactivate and reactivate the plugin to reset the "bound domain" or you can pass false
to the autoptimize_filter_ccss_bind_domain
filter to disable the domain binding.
Uncaught Error: Call to undefined function is_user_logged_in()
as reported by Matthew Rode.ao_ccss_queue
is scheduled and schedule if not.ao_ccss_queue_schedule
) to allow (power-)users to change the scheduling of the queue processing job.none
as critical CSS.