question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Capturing gzipped output, and reusing.

See original GitHub issue

I’m hoping to capture Javalin’s gzipped response (after, or in parallel to the response being streamed the client), and pipe it to Redis so that it can be used to serve a cached response on the subsequent requests across all nodes we’re running Javalin.

The usage pattern would preferably look something like this:

Start

  1. Fetch from cache

If cache value not present (a):

  1. Execute regular handler
  2. Send response via standard ctx.json()
  3. Stream or capture gzipped response, forward to redis (via .after handler?)
  4. END

If cache value present (b):

  1. Pipe Redis’ cached gzip bytes straight to the client
  2. END

Where should I be looking in the framework to get the gzipped response (4a), and to stream a prebuilt gzipped response to the client from the server, via a byte stream (2b)?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
champloo11commented, Apr 8, 2020

I’ve not yet had a chance to get to this. Hoping to create a proof of concept sometime starting early next week.

0reactions
tipsycommented, May 8, 2020

I’m going to close this issue now, but please feel free to post an update when/if you have one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Capturing gzipped output, and reusing. · Issue #913 · javalin ...
I'm hoping to capture Javalin's gzipped response (after, or in parallel to the response being streamed the client), and pipe it to Redis...
Read more >
extract random-positioned data from gzip files, even like `tail -f`
gztool can extract random-positioned data from gzip files with no penalty, including gzip tailing like with `tail -f`. gztool creates an index file...
Read more >
How to Enable GZIP Compression for Faster Web Pages
Learn how GZIP compression works to deliver web pages to browsers more quickly, and how to activate it on your web server.
Read more >
HttpWebRequest and GZip Http Responses - Rick Strahl
You start by adding an Accept-Encoding header to the request that tells the server to encode responses with GZip. That what the server...
Read more >
ob_gzhandler - Manual - PHP
Before ob_gzhandler() actually sends compressed data, it determines what type of content encoding the browser will accept ("gzip", "deflate" or none at all)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found