rust-embed-for-web icon indicating copy to clipboard operation
rust-embed-for-web copied to clipboard

Cached lazy decompression

Open alexforencich opened this issue 11 months ago • 1 comments

Random enhancement idea: instead of storing both the compressed and uncompressed versions of certain files, why not store only the compressed version, and then lazily decompress and cache it when the uncompressed version is requested? This way the decompression overhead is only paid once on the first request for each file. You could also have an option to "prime" the cache during start-up, decompressing all of the compressed files into memory.

alexforencich avatar Jan 24 '25 05:01 alexforencich

That's a good idea, although I wonder where you'd want to draw the line between adding a caching feature in the embed code itself vs. doing it at a higher level.

I'd be happy to accept any contributions to add such a feature if anyone is interested in adding it.

SeriousBug avatar Jan 24 '25 05:01 SeriousBug