nestjs/serve-static

Support `preCompressed` from `@fastify/static`

benmccann opened this issue · 1 comments

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

I have a SvelteKit app where I've set precompress: true to generate .br files. I'd like to serve them from my Nest app.

https://kit.svelte.dev/docs/adapter-static#options-precompress

Describe the solution you'd like

Support https://github.com/fastify/fastify-static?tab=readme-ov-file#precompressed

I thought from a quick glance at the source code that there was a chance the option would be passed straight through, but it didn't work in my testing.

Teachability, documentation, adoption, migration strategy

Add it to the types and docs. It's not there now.

What is the motivation / use case for changing the behavior?

Greatly improves page load time by serving brotli and gzip compressed files

Would you like to create a PR for this issue?