Skip to content

feat: use pre-compressed HTML pages#861

Merged
osteotek merged 2 commits intocrosspoint-reader:masterfrom
ngxson:xsn/brotli_compress
Feb 14, 2026
Merged

feat: use pre-compressed HTML pages#861
osteotek merged 2 commits intocrosspoint-reader:masterfrom
ngxson:xsn/brotli_compress

Conversation

@ngxson
Copy link
Contributor

@ngxson ngxson commented Feb 12, 2026

Summary

Pre-compress the HTML file to save flash space. I'm using gzip because it's supported everywhere (indeed, we are using the same optimization on llama.cpp server, our HTML page is huge 😅 ).

This free up ~40KB flash space.

Some users suggested using brotli which is known to further reduce 20% in size, but it doesn't supported by firefox (only supports if served via HTTPS), and some reverse proxy like nginx doesn't support it out of the box (unrelated in this context, but just mention for completeness)

PR:
RAM:   [===       ]  31.0% (used 101700 bytes from 327680 bytes)
Flash: [==========]  95.5% (used 6259244 bytes from 6553600 bytes)

master:
RAM:   [===       ]  31.0% (used 101700 bytes from 327680 bytes)
Flash: [==========]  96.2% (used 6302416 bytes from 6553600 bytes)

AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? PARTIALLY, only the python part

@ngxson ngxson requested a review from a team February 12, 2026 22:55
osteotek
osteotek previously approved these changes Feb 13, 2026
@jpirnay
Copy link
Contributor

jpirnay commented Feb 14, 2026

I am just working on a different approach:
CrossPointWebserver does serve the html content from the sd-card, if the required files are not present, then it will fetch them from the github server. Currently testing and fixing...

@ngxson
Copy link
Contributor Author

ngxson commented Feb 14, 2026

@jpirnay That's way over complicated I think. If we already had access to the internet, just simply include all CSS and JS content to be fetched from internet from the browser:

<link rel="stylesheet" href="https://crosspoint-reader.github.io/......">
<script src="https://crosspoint-reader.github.io/......" />

@jpirnay
Copy link
Contributor

jpirnay commented Feb 14, 2026

@jpirnay That's way over complicated I think. If we already had access to the internet, just simply include all CSS and JS content to be fetched from internet from the browser:

<link rel="stylesheet" href="https://crosspoint-reader.github.io/......">
<script src="https://crosspoint-reader.github.io/......" />

Well, the idea behind it is not only to download html pages but all other non-essential data (like hyphenation data) from the web, too. And - it's working great :-)
Just for html:

RAM:   [===       ]  31.0% (used 101700 bytes from 327680 bytes)
Flash: [========= ]  94.7% (used 6204932 bytes from 6553600 bytes)

@osteotek osteotek merged commit 5816ab2 into crosspoint-reader:master Feb 14, 2026
6 checks passed
jdk2pq added a commit to jdk2pq/crosspoint-reader that referenced this pull request Feb 14, 2026
* master:
  feat: use pre-compressed HTML pages (crosspoint-reader#861)
  docs: Add requirement device be on when flashing (crosspoint-reader#877)
  fix: Account for `nbsp;` character as non-breaking space (crosspoint-reader#757)
  feat: Add central logging pragma (crosspoint-reader#843)
Unintendedsideeffects pushed a commit to Unintendedsideeffects/crosspoint-reader that referenced this pull request Feb 17, 2026
## Summary

Pre-compress the HTML file to save flash space. I'm using `gzip` because
it's supported everywhere (indeed, we are using the same optimization on
[llama.cpp server](https://github.com/ggml-org/llama.cpp), our HTML page
is huge 😅 ).

This free up ~40KB flash space.

Some users suggested using `brotli` which is known to further reduce 20%
in size, but it doesn't supported by firefox (only supports if served
via HTTPS), and some reverse proxy like nginx doesn't support it out of
the box (unrelated in this context, but just mention for completeness)

```
PR:
RAM:   [===       ]  31.0% (used 101700 bytes from 327680 bytes)
Flash: [==========]  95.5% (used 6259244 bytes from 6553600 bytes)

master:
RAM:   [===       ]  31.0% (used 101700 bytes from 327680 bytes)
Flash: [==========]  96.2% (used 6302416 bytes from 6553600 bytes)
```

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? **PARTIALLY**, only the
python part
saslv pushed a commit to saslv/crosspoint-reader that referenced this pull request Feb 19, 2026
## Summary

Pre-compress the HTML file to save flash space. I'm using `gzip` because
it's supported everywhere (indeed, we are using the same optimization on
[llama.cpp server](https://github.com/ggml-org/llama.cpp), our HTML page
is huge 😅 ).

This free up ~40KB flash space.

Some users suggested using `brotli` which is known to further reduce 20%
in size, but it doesn't supported by firefox (only supports if served
via HTTPS), and some reverse proxy like nginx doesn't support it out of
the box (unrelated in this context, but just mention for completeness)

```
PR:
RAM:   [===       ]  31.0% (used 101700 bytes from 327680 bytes)
Flash: [==========]  95.5% (used 6259244 bytes from 6553600 bytes)

master:
RAM:   [===       ]  31.0% (used 101700 bytes from 327680 bytes)
Flash: [==========]  96.2% (used 6302416 bytes from 6553600 bytes)
```

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? **PARTIALLY**, only the
python part
el pushed a commit to el/crosspoint-reader that referenced this pull request Feb 19, 2026
## Summary

Pre-compress the HTML file to save flash space. I'm using `gzip` because
it's supported everywhere (indeed, we are using the same optimization on
[llama.cpp server](https://github.com/ggml-org/llama.cpp), our HTML page
is huge 😅 ).

This free up ~40KB flash space.

Some users suggested using `brotli` which is known to further reduce 20%
in size, but it doesn't supported by firefox (only supports if served
via HTTPS), and some reverse proxy like nginx doesn't support it out of
the box (unrelated in this context, but just mention for completeness)

```
PR:
RAM:   [===       ]  31.0% (used 101700 bytes from 327680 bytes)
Flash: [==========]  95.5% (used 6259244 bytes from 6553600 bytes)

master:
RAM:   [===       ]  31.0% (used 101700 bytes from 327680 bytes)
Flash: [==========]  96.2% (used 6302416 bytes from 6553600 bytes)
```

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? **PARTIALLY**, only the
python part
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 this pull request may close these issues.

4 participants