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

Allow serving GZip-ped resources from /? #76

Closed
minhducsun2002 opened this issue Apr 15, 2019 · 12 comments · Fixed by #80
Closed

Allow serving GZip-ped resources from /? #76

minhducsun2002 opened this issue Apr 15, 2019 · 12 comments · Fixed by #80

Comments

@minhducsun2002
Copy link
Contributor

minhducsun2002 commented Apr 15, 2019

It takes pretty long time to load 2.5MB of scripts from the network.

@dungwinux
Copy link
Member

@dungwinux dungwinux pinned this issue Apr 15, 2019
@natsukagami
Copy link

It is better to have pre-gzipped scripts rather than compressing on the fly. Maybe with a build script?

@minhducsun2002
Copy link
Contributor Author

I'll modify the build script of Hestia to produce a gzipped version - as part of the building flow.

@minhducsun2002
Copy link
Contributor Author

As with #76 (comment), express-static-gzip can be used instead of compressing on-the-fly.

We don't like our software to be slow, do we?

@minhducsun2002
Copy link
Contributor Author

See vnma0/hestia#133 for a building script.

@minhducsun2002
Copy link
Contributor Author

Also, @dungwinux, can you make a script to clear the source maps produced by CRA? It is not needed, and in some cases, intruders can leverage them to inject scripts & alter the behaviour of Hestia - something pretty much possible since we do not support HTTPS.

@dungwinux
Copy link
Member

later, not on this issue

@minhducsun2002
Copy link
Contributor Author

Well I did it anyway - CRA supports doing so.

@minhducsun2002
Copy link
Contributor Author

The gain from compressing the resources is substantial - at least 30% for short files, and most of the JS files takes 60% less space. For fonts, the gains is nearly 50%.

.
├── [1.1k]  asset-manifest.json
├── [ 347]  asset-manifest.json.gz
├── [3.9k]  favicon.ico
├── [3.5k]  favicon.ico.gz
├── [3.8k]  index.html
├── [1.8k]  index.html.gz
├── [ 286]  manifest.json
├── [ 194]  manifest.json.gz
├── [1.6k]  precache-manifest.b100312efdcbda0299c7061a2f68049f.js
├── [ 524]  precache-manifest.b100312efdcbda0299c7061a2f68049f.js.gz
├── [1.0k]  service-worker.js
├── [ 592]  service-worker.js.gz
└── [4.1k]  static
    ├── [4.1k]  css
    │   ├── [ 212]  5.b7043416.chunk.css
    │   ├── [ 126]  5.b7043416.chunk.css.gz
    │   ├── [ 192]  7.0c2bf69a.chunk.css
    │   ├── [ 121]  7.0c2bf69a.chunk.css.gz
    │   ├── [ 889]  main.1243f59c.chunk.css
    │   └── [ 341]  main.1243f59c.chunk.css.gz
    ├── [4.1k]  js
    │   ├── [431k]  0.28facd53.chunk.js
    │   ├── [120k]  0.28facd53.chunk.js.gz
    │   ├── [488k]  3.5a8c14d1.chunk.js
    │   ├── [127k]  3.5a8c14d1.chunk.js.gz
    │   ├── [2.0M]  4.ceaf8509.chunk.js
    │   ├── [469k]  4.ceaf8509.chunk.js.gz
    │   ├── [ 31k]  5.7f6cf64b.chunk.js
    │   ├── [8.0k]  5.7f6cf64b.chunk.js.gz
    │   ├── [9.5k]  6.15e5ba54.chunk.js
    │   ├── [3.2k]  6.15e5ba54.chunk.js.gz
    │   ├── [3.6k]  7.96851b26.chunk.js
    │   ├── [1.3k]  7.96851b26.chunk.js.gz
    │   ├── [2.2k]  8.a0c65e5e.chunk.js
    │   ├── [ 899]  8.a0c65e5e.chunk.js.gz
    │   ├── [ 37k]  main.8e28154c.chunk.js
    │   ├── [8.0k]  main.8e28154c.chunk.js.gz
    │   ├── [3.2k]  runtime~main.0537fcc3.js
    │   └── [1.5k]  runtime~main.0537fcc3.js.gz
    └── [4.1k]  media
        ├── [170k]  Roboto-Bold.7c181887.ttf
        ├── [ 90k]  Roboto-Bold.7c181887.ttf.gz
        ├── [171k]  Roboto-Medium.d52f011b.ttf
        ├── [ 90k]  Roboto-Medium.d52f011b.ttf.gz
        ├── [171k]  Roboto-Regular.18d44f79.ttf
        └── [ 89k]  Roboto-Regular.18d44f79.ttf.gz

@dungwinux
Copy link
Member

Where's the release, then?

@minhducsun2002
Copy link
Contributor Author

Feel free to get the artifacts from AppVeyor. Currently I don't have a way to provide the latest build from master - you'll have to build it yourself for quite some time.

@minhducsun2002
Copy link
Contributor Author

v1.5.2-20190421.1 is online. Feel free to check out.

@dungwinux dungwinux unpinned this issue Apr 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants