Skip to content

Support gzip compression #254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 of 4 tasks
marandaneto opened this issue Aug 27, 2024 · 2 comments
Closed
1 of 4 tasks

Support gzip compression #254

marandaneto opened this issue Aug 27, 2024 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed nodejs react-native web

Comments

@marandaneto
Copy link
Member

Is your feature request related to a problem?

When using captureMode=form, the compression is lz64 (base64).
When using captureMode=json, there's no compression.

Describe the solution you'd like

When using captureMode=json, we could either use gzip by default if possible, or offer another config to allow or not allow the gzip compression.
JS SDK has an option disable_compression: boolean.

Describe alternatives you've considered

Related sub-libraries

  • All of them
  • posthog-web
  • posthog-node
  • posthog-react-native

Additional context

Thank you for your feature request – we love each and every one!

@raikasdev
Copy link

Hey! For the lite package could this perhaps utilize the Compression Streams API (which is still newly available but becomes mainline in November 2025), which would possibly allow not having to include the fflate dependency. On the backend side the API has been stable since Node v18 and Deno v1.19, with no support yet for Bun. If the API isn't available it could just fallback to no compression.

If that sounds good I could perhaps work on this and submit a PR 👍

@marandaneto
Copy link
Member Author

Could be part of https://github.com/PostHog/posthog-js-lite/tree/v5 (#468)

For the lite package could this perhaps utilize the Compression Streams API (which is still newly available but becomes mainline in November 2025), which would possibly allow not having to include the fflate dependency

and fallback to no compression if not available.

On the backend side the API has been stable since Node v18 and Deno v1.19, with no support yet for Bun. If the API isn't available it could just fallback to no compression.

yep, that's great.

i'd love to see a PR.

@marandaneto marandaneto added the help wanted Extra attention is needed label Apr 29, 2025
raikasdev added a commit to raikasdev/posthog-js-lite that referenced this issue Apr 29, 2025
raikasdev added a commit to raikasdev/posthog-js-lite that referenced this issue Apr 29, 2025
raikasdev added a commit to raikasdev/posthog-js-lite that referenced this issue Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed nodejs react-native web
Projects
None yet
Development

No branches or pull requests

2 participants