Is your feature request related to a problem? Please describe.
WP Rocket is not adding swap when the fonts are loaded in the CPCSS, triggering the _Ensure text remains visible during webfont load_ PageSpeed recommendation.
Font in the CPCSS: https://i.vgy.me/FOAqGt.jpg
PageSpeed warning: https://files.slack.com/files-pri/T02RYMVKQ-F01B8GUBCL9/image.png

Steps to reproduce:
Describe the solution you'd like
Add font-display: swap to fonts in the CPCSS
Additional context
Related ProductBoard card: https://wp-media.productboard.com/insights/all-notes/notes/10854781
Related Ticket: https://secure.helpscout.net/conversation/1247047982/185016?folderId=2675957
Thank you!
@camilamadronero Can you please add the Steps to Reproduce so that it is easy for our dev team to reproduce the issue at their end? Thanks for the report.
The CPCSS is generated by the CPCSS tool, not by WP Rocket. and the font-swap is applied only in minified files, which is not the same process as inserting the CPCSS.
If we want to add this to the CPCSS, it should be done from the tool side, but we are not likely to do any change on it with our current plans.
Based on an idea from Jonathan, I did couple of tests. I used these mega sites that both triggered the Ensure text remains visible during webfont load recommendation.
When I enabled Minify CSS files, the recommendation went away. Even though swap was not added in the CPCSS, it was added in the CSS files. Tests was done with 3.8.2. Remember that we added #2791 in 3.7.
@webtrainingwheels @camilamadronero Can you please ask your customers to update to WP Rocket 3.7+ and enable Minify CSS and then check again?
@wp-media/php FYI, Based on the solution we found during our meeting, I added the need-grooming label.
CriticalCSSSubscriber::insert_critical_css_buffer()insert_critical_css_buffer() and apply apply_font_display_swap() function on $critical_css_contentinsert_critical_css_buffer() and add new fixtures for font-display:swap changesEffort [S], updating tests should be the most time consuming
Most helpful comment
The CPCSS is generated by the CPCSS tool, not by WP Rocket. and the font-swap is applied only in minified files, which is not the same process as inserting the CPCSS.
If we want to add this to the CPCSS, it should be done from the tool side, but we are not likely to do any change on it with our current plans.