Skip to content
This repository has been archived by the owner on Aug 23, 2020. It is now read-only.

Ideas (brotli, webp, GCC, ...) #4

Open
DanielRuf opened this issue Jan 4, 2019 · 10 comments
Open

Ideas (brotli, webp, GCC, ...) #4

DanielRuf opened this issue Jan 4, 2019 · 10 comments

Comments

@DanielRuf
Copy link

I had some more things in my mind.

A few of them are:

https://github.com/DanielRuf/talks/blob/master/03_wpo_unkonf_2018/slides.pdf and other slides and talks from me contain also a few more details and links

@larsbo
Copy link

larsbo commented Jan 4, 2019

feel free to make some PRs 😃

@DanielRuf
Copy link
Author

Will do so when I find the time. Until then this issue is meant as todo card (I do not have access to the projects and boards in this repo).

@shyim
Copy link
Member

shyim commented Jan 6, 2019

I don't understand the usage of brotli. For which reasons?

@DanielRuf
Copy link
Author

Brotli is used for CSS, JS, SVG and so on and is a much better compression algorithm than gzip. In performance and power usage.

@shyim
Copy link
Member

shyim commented Jan 6, 2019

I dont understand why this should be included here :). Its the job from the webserver to do that

@DanielRuf
Copy link
Author

brotli can be used as binary like cwebp and then we only have to add some lines to the .htaccess to enable it so no, it is not the job of the serer as the dynamic conversion would be slower.

You want to do that statically and AOT.
See https://css-tricks.com/brotli-static-compression/
I would not want to let Apache do any additional things on every request.
Otherwise we could use mod_pagespeed which would replace the webp plugin and brotli static gcompression but would generate additional load and hurt the performance.

@Hotte512
Copy link

Hi,

I thought I ask some things in this thread..

I think there could be a little more information about nodejs / npm installation and use.

Do we need it as Standalone or CLI installation ? like this?

(https://github.com/nodesource/distributions/blob/master/README.md#debinstall)
curl -sL https://deb.nodesource.com/setup_11.x | bash -
apt-get install -y nodejs
npm install -g purify-css

And will i need to add a cron job on ./bin/console frosh:purify:css or will FroshPerf trigger it after template compilation?

(That way i got [OK] Purified css from 502.94K to 476.93K)

@DanielRuf
Copy link
Author

Better ask this in a separate issue as this is not related to this issue ;-)

@DanielRuf
Copy link
Author

To answer your question, both should be on your path (or globally installed).

See

return (bool) $finder->find('purifycss');
and
array_unshift($arguments, $finder->find('purifycss'));
array_unshift($arguments, $finder->find('node'));

But personally I would use Closure Stylesheets.

@DanielRuf
Copy link
Author

Some scripts that I've used for some projects (with slightly different content):

https://github.com/DanielRuf/brotli-bootstrap/blob/master/bootstrap.sh
https://github.com/DanielRuf/bakery/blob/master/bakery.sh#L22-L26 for the cache directory, done with these lines and bakery .

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

No branches or pull requests

4 participants