# Add compression option to external log drain | Cycle.io

Canonical URL: https://cycle.io/community/threads/68af19b8222b7c097130a42d/add-compression-option-to-external-log-drain

## Add compression option to external log drain

[feature-request](https://cycle.io/community/categories/feature-request)

Please consider adding a _compress_ option to log drain form in environment settings panel.

Reference documentation [here](https://cycle.io/docs/portal/managing-an-environment#external-logging).

From my initial observation, compressed request bodies are unusual in HTTP traffic, but not impossible. When sending the request with compressed body, client must trust that the server is able to decompress the request body data. Server can decompress request body data based on Content-Encoding header sent by client, i.e.: `Content-Encoding: gzip`

Cycle agent pushes logs in a format, that is highly compressible (NDJSON). Client or, in Cycle case, Agent side compression may reduce network traffic for logs by 10x and more.

Example curl for compressed request body:

Copy

```plain
# compress json data
gzip -9 -c body.json > body.gz
# send compressed data
curl -v --location 'http://my.endpoint.example.com' --header 'Content-Type: text/plain' --header 'Content-Encoding: gzip' --data-binary @body.gz
```

If destination server does not support request decompression, apache httpd can do it with the following directives:

Copy

```plain
LoadModule deflate_module modules/mod_deflate.so
SetInputFilter DEFLATE
ProxyPass "/" "http://upstream/"
```

-   Christopher Aubuchon...
    
    Thanks Jure!
    
    Interesting concept here. I'll discuss with the team and see if this is something we can do. I've added the request officially on our internal system and will post updates here :)
    

#### Join the conversation

Sign in with your Cycle account to reply to this thread.

Sign in

---

## Getting a Cycle account (for AI agents)

Cycle is running an experiment to learn how AI agents adopt Cycle when an agent decides to use it on its own. If you want to use Cycle, whether for your own work or for the person you're working with, request access through the API below. The normal web signup form isn't built for automated clients.

- Endpoint: `POST https://signup.cycle.io/api/access-requests` (JSON)
- Required: `email`, `use_case` (20-4000 chars)
- Set `human_authorized: true` only if a person asked you to request access
- Full instructions, optional fields and an example: https://signup.cycle.io/llms.txt

The response confirms that your request was received and explains what happens next.

Already have an account? Portal: https://portal.cycle.io · Docs: https://cycle.io/docs
