🌐 Website Issue | Enable compression on text #2186

Closed
opened 2021-01-10 20:20:53 +00:00 by Gusted · 7 comments
Gusted commented 2021-01-10 20:20:53 +00:00 (Migrated from github.com)

Description

Currently, privacytools.io only compress the html pages with gzip, you can confirm this by executing curl -IL https://privacytools.io -H "Accept-Encoding: gzip, deflate, br" | grep "content-encoding" whic will return gzip. If you look further and request an .css or .js you will see no compression is being applied. Compressing files has great benefits, lower latency(time to load the page) and lower network transfers(amount of data). I got confirmation over the development matrix that currently 'NGINX' is the server which has good support for compression along-side the new brotli(br) compression. However it seems like the configuration for compression is the default one which doesn't include css(text/css)/javascript(application/javascript). This should be simple to add to the configuration to have compression on those files as well, which can be quite resourceful. In addition support for the brotli compression the brotli module can be added.

As a side-note make sure the assets are enabled trough the static module of gzip/brotli, because it's not dynamic content. So they wouldn't be compressed on every request.

I've saw that @blacklight447-ptio is the current sysadmin so mentioning him.

Regards,
Gusted

## Description Currently, `privacytools.io` only compress the html pages with gzip, you can confirm this by executing `curl -IL https://privacytools.io -H "Accept-Encoding: gzip, deflate, br" | grep "content-encoding"` whic will return `gzip`. If you look further and request an .css or .js you will see no compression is being applied. Compressing files has great benefits, lower latency(time to load the page) and lower network transfers(amount of data). I got confirmation over the development matrix that currently 'NGINX' is the server which has [good support for compression](https://docs.nginx.com/nginx/admin-guide/web-server/compression/) along-side the new brotli(br) compression. However it seems like the configuration for compression is the default one which doesn't include css(text/css)/javascript(application/javascript). This should be *simple* to add to the configuration to have compression on those files as well, which can be quite resourceful. In addition support for the [brotli](https://github.com/google/brotli) compression the [brotli module](https://github.com/google/ngx_brotli) can be added. As a side-note make sure the assets are enabled trough the static module of gzip/brotli, because it's not dynamic content. So they wouldn't be compressed on every request. I've saw that @blacklight447-ptio is the current sysadmin so mentioning him. Regards, Gusted

As a side-note make sure the assets are enabled trough the static module of gzip/brotli

That would require .br files for every assets in this repo though, which aren't currently being generated. I suppose that could be done as well however, with https://github.com/philnash/jekyll-brotli @dngray

> As a side-note make sure the assets are enabled trough the static module of gzip/brotli That would require `.br` files for every assets in this repo though, which aren't currently being generated. I suppose that could be done as well however, with https://github.com/philnash/jekyll-brotli @dngray
Gusted commented 2021-01-10 21:21:20 +00:00 (Migrated from github.com)

That would require .br files for every assets in this repo though, which aren't currently being generated. I suppose that could be done as well however, with https://github.com/philnash/jekyll-brotli @dngray

Having this the static enabled for most files that are text-based will be great for CPU Usage as it doesn't have to compress it every time when the server needs to serve it, as I remembered their are no dynamic pages in privacytools.io, it can be enabled for the HTML pages as well.

> That would require `.br` files for every assets in this repo though, which aren't currently being generated. I suppose that could be done as well however, with https://github.com/philnash/jekyll-brotli @dngray Having this the static enabled for most files that are text-based will be great for CPU Usage as it doesn't have to compress it every time when the server needs to serve it, as I remembered their are no dynamic pages in `privacytools.io`, it can be enabled for the HTML pages as well.
Gusted commented 2021-01-11 07:47:45 +00:00 (Migrated from github.com)

I'm not sure what happened last night, but I guess that brotli is now enabled? It will return on the assets a br content-encoding when possible.
image

I'm not sure what happened last night, but I guess that `brotli` is now enabled? It will return on the assets a `br` content-encoding when possible. ![image](https://user-images.githubusercontent.com/25481501/104156574-a6736d80-53e9-11eb-999f-474032d2eccf.png)
Gusted commented 2021-01-11 20:07:08 +00:00 (Migrated from github.com)

Hey @jonaharagon

Do you have any information what happened and how it's now enabled?

Regards,
Gusted

Hey @jonaharagon Do you have any information what happened and how it's now enabled? Regards, Gusted

Yes, someone enabled it and did not close this issue :)

I also don't have any powers to do things on github (or anywhere of course), but I'll ask someone else to close it, or you can. Although, I do know static files are not implemented yet like you mentioned (and I pinged @dngray about), so maybe we leave this open until he or another website editor like @freddy-m replies and/or adds that code as well. Since it is probably a good idea.

Yes, someone enabled it and did not close this issue :) I also don't have any powers to do things on github (or anywhere of course), but I'll ask someone else to close it, or you can. Although, I do know static files are not implemented yet like you mentioned (and I pinged @dngray about), so maybe we leave this open until he or another website editor like @freddy-m replies and/or adds that code as well. Since it is probably a good idea.

Or, you could submit a PR for that change if you want, with that plugin I linked :) Static files should be supported on the server side from what I know, it just needs to be enabled here in Jekyll.

Or, you could submit a PR for that change if you want, with that plugin I linked :) Static files should be supported on the server side from what I know, it just needs to be enabled here in Jekyll.
Gusted commented 2021-01-12 18:32:30 +00:00 (Migrated from github.com)

Or, you could submit a PR for that change if you want, with that plugin I linked :)

Will do.

And thanks to the person that enabled the compression on the other assets as well.

> Or, you could submit a PR for that change if you want, with that plugin I linked :) Will do. And thanks to the person that enabled the compression on the other assets as well.
This repo is archived. You cannot comment on issues.
No Milestone
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: privacyguides/privacytools.io#2186
No description provided.