Enabling gzip encoding

Has anybody given thought to enabling gzip compression on their Atlassian Connect add-on? Is that something that can even be done for Connect modules?

Sure, why wouldn’t it be possible? The browser will request the iframe endpoint and will pass the accepted encoding header. If that includes gzip support, the browser will take care of the compression. So you can safely add support for compression to your server. There is nothing specific to Atlassian Connect add-ons which would prevent gzip compression to work

1 Like

Does it though? If I have a “generalPages” module in my descriptor with the URL “/welcome”, will the “Accept-Encoding” header be sent to the /welcome end-point? You can’t specify HTTP headers in the module definitions, or can you?

You don’t have to specify them, the browser will take care of this :slight_smile:
If you add a generalPages module, this will create a link in the host application navigation. As soon as someone clicks on that link, you will go to an Atlassian Connect placeholder page, which will include an iframe with src attribute set to your /welcome end-point. The browser will load this iframe source document and will add the Accept-Encoding header if it supports it.

This is all done client-side, no server-side processing involved. If the client browser supports gzip encoding, it will add that header to all requests it initiates (incl. XHR). The only thing you have to worry about is that your server will need to respond correctly to the Accepted-Encoding header.

2 Likes