# Deflate compression

**URL:** <https://zola.discourse.group/t/deflate-compression/1024>\
**Category:** Feature requests\
**Created:** [August 29, 2021, 8:09pm UTC](https://zola.discourse.group/t/deflate-compression/1024 "2021-08-29T20:09:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bemyak](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/bemyak/32/1106_2.png) [@bemyak](https://zola.discourse.group/u/bemyak)\
**Post date:** [August 29, 2021, 8:09pm UTC](https://zola.discourse.group/t/deflate-compression/1024/1 "2021-08-29T20:09:54Z")

</div>

Some APIs require data to be compressed using the deflate algorithm together with base64 encoding. (e.g. [PlanUML](https://plantuml.com/text-encoding), [Korki](https://docs.kroki.io/kroki/setup/encode-diagram/)). However, Zola doesn’t support it.

What do you think about adding two new filters: `deflate_compress` and `deflate_decompress`?

---

<div class="post-metadata">

**Author:** ![Marco](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/marco/32/478_2.png) [@Marco](https://zola.discourse.group/u/Marco)\
**Post date:** [September 2, 2021, 9:47am UTC](https://zola.discourse.group/t/deflate-compression/1024/2 "2021-09-02T09:47:32Z")

</div>

Hi bemyak,

for some API’s these features would very useful.

You can use Kroki already. when you use the POST api(supported in Zola since 0.14) of Kroki you do not need to compress your data.

You see an example in the docs: [Zola remote content](https://www.getzola.org/documentation/templates/overview/#remote-content)

For more details see the kroki docs on POST: [Kroki!](https://kroki.io/#post-request)

---

<div class="post-metadata">

**Author:** ![bemyak](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/bemyak/32/1106_2.png) [@bemyak](https://zola.discourse.group/u/bemyak)\
**Post date:** [September 2, 2021, 10:04am UTC](https://zola.discourse.group/t/deflate-compression/1024/3 "2021-09-02T10:04:01Z")

</div>

Hi, @Marco !

That’s what I’m using right now. I embed my diagrams as SVG files right into HTML, so that text could be copied. Alongside with this, I’d like to have an `Open as image` button, that would open the PNG version in a new tab. To make it work, I need to put a link there, which means I need a GET request.

---

<div class="post-metadata">

**Author:** ![Marco](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/marco/32/478_2.png) [@Marco](https://zola.discourse.group/u/Marco)\
**Post date:** [September 2, 2021, 10:21am UTC](https://zola.discourse.group/t/deflate-compression/1024/4 "2021-09-02T10:21:23Z")

</div>

Ah that makes sense.  
That would be possible with your suggested filters.

---

<div class="post-metadata">

**Author:** ![bemyak](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/bemyak/32/1106_2.png) [@bemyak](https://zola.discourse.group/u/bemyak)\
**Post date:** [September 15, 2021, 10:18pm UTC](https://zola.discourse.group/t/deflate-compression/1024/5 "2021-09-15T22:18:57Z")

</div>

I created a Pull Request with the implementation: [Add defalte filters by bemyak · Pull Request #1622 · getzola/zola · GitHub](https://github.com/getzola/zola/pull/1622)
