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

Add rule(s) for HTTP compression #12

Closed
alrra opened this issue Mar 6, 2017 · 3 comments
Closed

Add rule(s) for HTTP compression #12

alrra opened this issue Mar 6, 2017 · 3 comments

Comments

@alrra
Copy link
Contributor

alrra commented Mar 6, 2017

gzip

  1. Check is something is served compressed using gzip:

    Make a request with the Accept-Encoding: "gzip" header, then verify if the response is served with the Content-Encoding: "gzip" header and the body of the response starts with 1f 8b.

  2. What should be compressed with gzip:

    File type Commonly used
    file extension(s)
    Commonly used
    media types(s)
    Atom .atom application/atom+xml
    App Cache Manifest .appcache text/cache-manifest
    BMP .bmp image/bmp
    CSS .css text/css
    Cursors Images .cur image/x-icon
    image/vnd.microsoft.icon
    Embedded OpenType font .eot application/vnd.ms-fontobject
    Favicon .ico image/x-icon
    image/vnd.microsoft.icon
    HTML .html
    .htm
    ...
    text/html
    application/xhtml+xml
    HTML Components .htc text/x-component
    JavaScript .js application/javascript
    text/javascript
    JSON .json
    ...
    application/json
    application/<something>+json
    OpenType font .otf font/opentype
    RDF .rdf application/rdf+xml
    RSS .rss application/rss+xml
    Source Maps .map application/json
    SVG .svg image/svg+xml
    TrueType font .ttc
    .ttf
    application/x-font-ttf
    TXT .txt text/plain
    vCard .vcard
    vcf
    text/vcard
    VTT .vtt text/vtt
    XML .xml
    ...
    application/xml
    text/xml
    application/<something>+xml
    Web App Manifest .webmanifest
    .json
    application/manifest+json

    Notes:

Zopfli

  1. Check is something is served compressed using Zopfli:

    Same as with gzip, just that we need to detect Zopfli.

  2. What should be compressed with Zopfli:

    Same as with gzip.

    Note(s):

    • We will need to a check if WOFF fonts use Zopfli compression internally.

Brotli

  1. Check is something is served compressed using Brotli.

    Make a request with the Accept-Encoding: "br" header, then verify if the response is served with the Content-Encoding: "br" header (no magic numbers?).

    Note: Brotli compressed responses should be served only over HTTPS.

  2. What should be compressed with Brotli:

    Same as with gzip.


Note: This is just a starting point, we will probably split this into more specific issues / rules.

@molant
Copy link
Member

molant commented Jun 22, 2017

This has a dependency on #164 to work cross collector.

@AndrewCraswell
Copy link

+1 for this. Especially the highlighting of Brotli compression!

@molant
Copy link
Member

molant commented Dec 13, 2017

@alrra is working hard on this

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

Successfully merging a pull request may close this issue.

3 participants