Skip to content

GZip content encoding for wasm and svg #5265

@canyon-service

Description

@canyon-service

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
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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions