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

Rules: definition of internal default rules #46

Closed
rdpanek opened this issue Feb 5, 2021 · 23 comments
Closed

Rules: definition of internal default rules #46

rdpanek opened this issue Feb 5, 2021 · 23 comments
Assignees
Labels
👌 approved 💭 idea / new feature New feature or request 🧬 listener-agent Data analytics, evaluating and alerting

Comments

@rdpanek
Copy link
Contributor

rdpanek commented Feb 5, 2021

IDEA

Canarytrace Listener will be automatically check the rules of quality a web application.

Sources:

@rdpanek rdpanek added 💭 idea / new feature New feature or request 🧬 listener-agent Data analytics, evaluating and alerting labels Feb 5, 2021
@rdpanek rdpanek self-assigned this Feb 5, 2021
@rdpanek
Copy link
Contributor Author

rdpanek commented Feb 5, 2021

CSS & JS

  • must be compresed by gzip or br

@rdpanek rdpanek pinned this issue Feb 5, 2021
@rdpanek rdpanek changed the title Listener: automatic rules Canarytrace Listener: automatic rules Feb 5, 2021
@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 5, 2021

HTTP/2

Verifiable by Listener ✔️

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 5, 2021

Brotli text/plain compression

  • br (or at least gzip) is used for plain text compression
  • Browsers will accept Brotli (=br) only if the user is visiting a website over HTTPS
  • Brotli with setting 4 is both significantly smaller AND compresses faster than gzip
    -- see https://expeditedsecurity.com/blog/nginx-brotli/
Verifiable by Listener ✔️

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 8, 2021

HPACK compression for HTTP/2

  • If using HTTP/2, HPACK compression for HTTP response headers is used
  • a note: Some HTTP/2 servers may not fully support the specification.
Verifiable by Listener

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 8, 2021

HTTP/2 Server Push - NOT recommended

Verifiable by Listener

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 8, 2021

HTTP/3

Verifiable by Listener ✔️

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 8, 2021

Response code 404

  • you have NO Not found resources on your site
Verifiable by Listener ✔️
  • if it happens we come across 404:
    -- response body size for 404 is small
Verifiable by Listener ✔️

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 8, 2021

well known (or suspicious) - low-hanging fruits

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 11, 2021

Never more 404 on favicon.ico

Verifiable by Listener ✔️

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 11, 2021

LCP (Largest Contentful Paint) < 2.5s

-- see https://web.dev/vitals/#core-web-vitals

Verifiable by Listener ✔️

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 11, 2021

FID (First Input Delay) < 100ms

-- see https://web.dev/vitals/#core-web-vitals

Verifiable by Listener ✔️

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 11, 2021

CLS (Cumulative Layout Shift) < 0.1

-- see https://web.dev/vitals/#core-web-vitals

Verifiable by Listener ✔️

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 11, 2021

Removed unused CSS/JavaScript.

  • use CSS and JavaScript code coverage in Chrome to learn which code has been executed/applied and which hasn’t. Once you've detected unused code,find those modules and lazy load with import().
Verifiable by Listener

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 11, 2021

Constrained the impact of third-party scripts

Verifiable by Listener

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 11, 2021

HTTP headers set properly

  • Without proper HTTP cache headers (=Cache-Control) setting, browsers will set them automatically
Verifiable by Listener ✔️

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 11, 2021

use defer instead of async to load critical JavaScript asynchronously

Verifiable by Listener

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 11, 2021

Not use BOTH async and defer

Verifiable by Listener

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 11, 2021

used resource hints to speed up delivery

Verifiable by Listener

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 11, 2021

assets cached in a service worker cache (ToDo)

  • assets such as fonts, styles, JavaScript and images
Verifiable by Listener

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 11, 2021

Optimized images

  • with Squoosh, mozjpeg, guetzli, pingo and SVGOMG,
  • AVIF/WebP served with an image CDN

@rdpanek rdpanek changed the title Canarytrace Listener: automatic rules Listener: definition for automatic rules Feb 11, 2021
@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 12, 2021

budget for critical-path resources (CSS, JS, HTML, and data) should be max. 170KB gzipped

Verifiable by Listener ✔️

@Tomas-Kostka
Copy link

Tomas-Kostka commented Feb 12, 2021

Serve legacy code only to legacy browsers

Verifiable by Listener

@rdpanek rdpanek changed the title Listener: definition for automatic rules Rules: definition of internal default rules Mar 5, 2021
@rdpanek
Copy link
Contributor Author

rdpanek commented Mar 5, 2021

Final table

# title Index Condition Min count /hour Score
1 Failed check your page! c.report test step failed 2 10
2 Encoding of response with Javascript files must contains gzip or brotli compression. c.response gzip or br missing in headers.content-encoding 10 40
3 Encoding of response with CSS files must contains gzip or brotli compression. c.response gzip or br missing in headers.content-encoding 10 40
4 Higher response time. c.performance-entries > 3000ms 10 40
5 WebVitals LCP exceeded. c.audit > 2500ms 5 40
6 WebVitals TTI exceeded. c.audit > 5000ms 5 40
7 WebVitals CLS exceeded. c.audit > 0.1 5 40
8 LoadEventEnd exceeded. c.performance-entries > 4000ms 5 40

@rdpanek rdpanek closed this as completed Jun 2, 2021
@rdpanek rdpanek unpinned this issue May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👌 approved 💭 idea / new feature New feature or request 🧬 listener-agent Data analytics, evaluating and alerting
Projects
None yet
Development

No branches or pull requests

2 participants