philipp-winterle / crittr

High performance critical css extraction with a great configuration abilities

Home Page:https://hummal.github.io/crittr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CSS files which are on CDN are not processed

Creativico opened this issue · comments

Describe the bug
I was testing on same site url and same page of the site.
When the CSS files were ON the CDN generated critical had 8kB, while the CSS files were OFF the CDN the generated critical had 52kB.
Also the Crittr run time while files are ON the CDN: 8.8s, Crittr run time while the files are OFF the CDN: 15.7s - runned via terminal, all the same parameters.

The site screenshot from crittr in both cases is completely normal, which means the CSS files ARE loading correctly.
The generated critical 8kB CSS breaks the site until other CSS is lazy loaded

To Reproduce

  1. Put ALL CSS files on the CDN
  2. Generate critical via terminal
    node /var/www/critical/crittr.js --url="https://whatever.com"
  3. Produced CSS file is far less than when CSS files are OFF the CDN.

Expected behavior
It should be more or less identical +/- 10% size due that CDN changes relative paths to absolute.

Screenshots
https://jmp.sh/cWGJaHp
https://jmp.sh/rhgEri7

I had time to check your problem and it seems that the cdn is not reachable by crittr at the time it has to be reached.
Crittr does not remove or download images from css files processed. It just opens a headless browser and checks the page. If the css is not as big as it should be it seems you do not open the url you want to open.

I would suggest to run crittr with the puppeteer - headless: true option to get an impression of what the website is looking.