DioxusLabs / DioxusLabs/dioxus

GZip content encoding for wasm and svg

Open
#5,265 3 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

## Feature Request

I have a tool that combines all the SVG files that are used in the repo into a single SVG sprite and use css to select the correct sprite.
This file gzips well to around 25% of its original size. Is it possible to enable compression for Assets?

## Implement Suggestion
Similar to as you can do with
`asset!("/assets/icon.png", AssetOptions::image().with_avif());`
to
`asset!("/assets/sprites.svg", AssetOptions::image().with_gz());`
Or is it possible I can manually compress the file and set the response header: "content-encoding: gzip" for that resource?

I had a look at to reduce the size of the wasm
[https://dioxuslabs.com/learn/0.5/cookbook/optimizing/#build-configuration](https://dioxuslabs.com/learn/0.5/cookbook/optimizing/#build-configuration)
It greatly reduced the size of the server side binary but only reduced the wasm by 5% which I'm mainly interested in.
Are there tips and tricks to reduce the size of the wasm bumdle?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.