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

Dioxus Fullstack server doesn't use/serve Brotli-compressed files #2491

Closed
1 of 3 tasks
Andrew15-5 opened this issue Jun 8, 2024 · 2 comments
Closed
1 of 3 tasks

Comments

@Andrew15-5
Copy link
Contributor

Problem

I noticed that ./dist/ has .br copies of some files (and also .gz and .br.gz) which are simply not used by the compiled server. Tested with Firefox and Ungoogled Chromium, so this means that it's definitely not a web browser's issue.

It's nice that at least Gzip is used, although I don't know how exactly, is this a default feature of Axum? The requested URL/file doesn't have .gz extension. Same happened with serve.

cd dist && du -sb *:

2096221 assets
0       __assets_head.html
20      __assets_head.html.gz
132770  favicon.ico
47571   favicon.ico.br
47599   favicon.ico.br.gz
50818   favicon.ico.gz
23395   header.svg
3815    header.svg.br
3838    header.svg.br.gz
4627    header.svg.gz
518     index.html
326     index.html.gz
652     main.css
241     main.css.br
264     main.css.br.gz
336     main.css.gz
4482216 project
1580325 project.gz

It looks that .br.gz and .gz alternatives can be removed for this particular example.

I get the things that will be transferred should be compressed, but server binary? Is this an automatic process without filtering?

CC @ealmloff

Steps To Reproduce

Steps to reproduce the behavior:

cd /tmp &&
dx new -y --subtemplate Fullstack project &&
cd project &&
dx build -r --platform fullstack &&
./dist/project

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

Firefox

Ungoogled Chromium

Environment:

  • Dioxus version: 0.5.2 (d6fc5dc)
  • Rust version: 1.80.0-nightly
  • OS info: Pop!_OS
  • App platform: fullstack

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later
@ealmloff
Copy link
Member

I cannot reproduce this issue using the matching git version of both the CLI and fullstack (79e18c2). You may be using a version of dioxus fullstack before #2329

@ealmloff ealmloff closed this as not planned Won't fix, can't repro, duplicate, stale Jun 10, 2024
@Andrew15-5
Copy link
Contributor Author

Oh, man... I forgot that CLI/codebase dependencies desynchronization is a thing (struggle with "living on the edge"). I tried with d6fc5dc, but I faced some internal Signal compilation error. Using 79e18c2 worked fine.

I need to remember to add something like this to my future projects:

[patch.crates-io]
# dioxus = { git = "https://github.com/dioxuslabs/dioxus" }
dioxus = { git = "https://github.com/dioxuslabs/dioxus", rev = "79e18c2d6" }

Now the directory only has files that are actually used:

1506719 assets
0       __assets_head.html
132770  favicon.ico
47571   favicon.ico.br
23395   header.svg
3815    header.svg.br
518     index.html
652     main.css
241     main.css.br
4346472 project

image

I've tested with curl and indeed the server only sends Brotli version if the client accepts this encoding.

P.S. As this feature/bug is already resolved on the main, IMO this issue should be closed as completed instead.

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

No branches or pull requests

2 participants