fastify / fastify-compress

Fastify compression utils

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compression not working for static Assets

musdy opened this issue · comments

Compression not working for Static assets.

screenshot 2019-02-22 at 13 32 55

Is there a way to enable Fastify Compress to work with Fastify-Static?

Current code:

`fastify.register(require("fastify-compress"));

fastify.register(require("fastify-static"), {
root: path.join(__dirname, "assets"),
prefix: "/assets" // optional: default '/'
});`

Thank you.

Can you try setting the threshold option to 0 for compress plugin?

I think you are not serving those files via fastify-static. I think those files are served directly from nextjs .

Hello @mcollina . I've tried using:

fastify.use(require("compression")());

But have been receiving "this._implicitHeader is not a function" error. Using Next JS with Fastify with compression.

Node version: v11.10.0
Npm version: 6.7.0

Tried using fastify/fastify-compress as well. Then I receive:

TypeError [ERR_HTTP2_INVALID_CONNECTION_HEADERS]: HTTP/1 Connection specific headers are forbidden: "connection"

@musdy that will be fixed in the next 1.x release (next week).

fastify compress was not working when using nextjs

I tried fastify.register(require("fastify-compress"))

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.