loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Loopback API response is getting stuck at compression

Open blackvirus18 opened this issue 11 years ago • 10 comments

All my loopback APIs response is getting stuck at compression. Compression is defined as part of my middleware with a threshold of 512, now when I disable compression APIs are responding but with compression enabled I am not getting any response.

Versions being used [email protected] [email protected] [email protected]

blackvirus18 avatar Jul 29 '15 17:07 blackvirus18

How does your middleware.json look like? I cannot reproduce the problem locally and I can see compression in use.

{
  "Date": "Wed, 29 Jul 2015 18:04:09 GMT",
  "Content-Encoding": "gzip",
  "X-Powered-By": "Express",
  "Etag": "W/\"68f-r2J1D7KPnKtOMys5+f8Qeg\"",
  "Vary": "Origin, Accept-Encoding",
  "Content-Type": "application/json; charset=utf-8",
  "Access-Control-Allow-Credentials": "true",
  "Connection": "keep-alive",
  "Transfer-Encoding": "chunked"
}

raymondfeng avatar Jul 29 '15 18:07 raymondfeng

Middleware.json

{ "initial:before": { "loopback#favicon": {} }, "initial": { "compression": { "params": {"threshold": 512} } }, "session": { }, "auth": { }, "parse": { }, "routes": { "loopback#status": { "paths": "/status" } }, "files": { "loopback#static": { "params": "$!../client" } }, "final": { "./middleware/url-not-found": {} }, "final:after": { "errorhandler": {} } }

blackvirus18 avatar Jul 29 '15 18:07 blackvirus18

Nothing suspicious. You can try to run DEBUG=compression node . to see how compression is used.

raymondfeng avatar Jul 29 '15 18:07 raymondfeng

Did that too in this case the response is getting stuck at gzip compression

blackvirus18 avatar Jul 29 '15 18:07 blackvirus18

If you can share the test case to reproduce the problem, we can take a look.

raymondfeng avatar Jul 29 '15 18:07 raymondfeng

It's tough to share a test case because it's happening only for one machine the funny part is if I disable the compression APIs start working.

blackvirus18 avatar Jul 30 '15 06:07 blackvirus18

Which endpoint? I had a similar issue earlier today with /change-stream.

ritch avatar Aug 06 '15 22:08 ritch

Any updates on this issue? I also meet this problem while I am working on the /change-stream with the middleware with compression. If the compression is configured, nothing will be returned from the /change-stream. Without compression, everything works fine.

mackwan84 avatar Sep 09 '15 08:09 mackwan84

@ritch, I gave this issue a bug tag since you said you had a similar issue although I was not able to reproduce.

Should this be investigated further? It seems to be on a machine to machine basis...

richardpringle avatar Dec 08 '15 15:12 richardpringle

Is this issue got fixed?i tried using the params with threshold 512 and installed compression 1.7 version and i get the following error

compression: undefined not compressible +7s
compression no compression: filtered +0ms

kgrvamsi avatar Jul 22 '18 02:07 kgrvamsi