Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: forceExclude Selectors and URLS #10

Open
fluxism opened this issue Nov 8, 2020 · 2 comments
Open

Feature Request: forceExclude Selectors and URLS #10

fluxism opened this issue Nov 8, 2020 · 2 comments

Comments

@fluxism
Copy link

fluxism commented Nov 8, 2020

I have an events calendar plugin. wp-criticalcss is crawling infinitely forward and backwards on the calendar. Can we use a regex or filter to prevent this?

Also a forceExclude option similar to forceInclude is needed. I use Cloudflare Workers to cache and inline google fonts and t his plugin is duplicating the inline css which is quite heavy.

@pcfreak30
Copy link
Owner

Thanks for letting me know. Also a forceExclude option similar to forceInclude is needed This is simply passed through to the API, so there would need to be API support for this.

@pocketjoso would need to chime in regarding this.

For the crawling issue, can you give an example URL of a calender and urls it is hitting?

Thanks :)

@pocketjoso
Copy link

Hi,
There's currently no way to filter out At-rules such as @font-face.
The forceInclude option only filters out CSS selectors, and At-rules are not CSS selectors so they are not handled - the same would apply if we added API support for forceExclude.

I don't have any short term solution for this, but we might add support to filter out At-rules in the future.
From what I can see your font-face rules contribute 2kb to your critical css size - excluding any GZIP which would further reduce this size. As annoying as it is to have this duplication, perhaps it can be acceptable to keep until there's a way to handle it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants