Jira and Apache reverse proxy: enable gzip compression

Michal Dobrzyniecki July 9, 2019

Hello,

We run a reasonably well tuned Jira Server instance (7.13, around 100k issues). We use Apache reverse proxy. Gzip is disabled both in Jira and in Apache. No caching on the proxy.
Our users are all around the globe, some with latencies around 200 ms to Jira server (and proxy), and the experience for them is not ideal, especially with cold cache in their browsers. Page load times can go as high as 30-40 seconds, spent mainly on loading large CSS and JS files. I came up with an idea of enabling gzip compression on Apache to alleviate the situation.

A second proxy was set up, an exact clone of the production one, and I started testing. Added:

AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/plain text/xml application/javascript
KeepAlive On

to Apache configuration.

Initial testing – awesome, it works! Page load times with cold cache are much faster, files get compressed, and I noticed no adverse effects on Jira functionality.

Further testing – it works, but client browser cache does not get used for compressed files. Without gzip, large CSS and JS were cached by the browser and reused (response code 304), which improved user experience significantly. With compression enabled, files are much smaller, but response codes are always 200, so everything is downloaded repeatedly on every page load.

Overall, enabling gzip compression made things worse, as it removed the benefits of a populated browser cache.

Can anyone offer any tips about gzip compression that plays well with user’s browser cache?

2 answers

0 votes
Abyakta Lenka April 19, 2021

@Alexis Robert  did you found the fix for Apache .

I mean did you enabled gzip compression at Apache level or did you do anything else ??

 

Abyakta

0 votes
Alexis Robert
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2019

Hi @Michal Dobrzyniecki , 

 

Atlassian actually does not recommend enabling gzip compression when using Apache as it's known to cause performance issues as you can see here

What would probably help in your case is a Datacenter instance with CDN support. This feature is coming in Jira 8.3 I think.

Michal Dobrzyniecki July 9, 2019

Hi @Alexis Robert

Thank you for your answer! I agree that Atlassian does not recommend enabling gzip compression in Jira setings when using Apache. However that is not what I am trying to do, as I want to enable gzip compression on the Apache, as Atlassian recommends here (see Workaround, Cause#1):

We need to make sure that Gzip compression is enabled ether on JIRA or better on the reserve proxy, this should save JIRA from losing CPU cycles on compression.

There is also a configuration tip for Confluence, right here, but I am not sure if similar applies to Jira.

Also, thank you for the tip about CDN, this is truly great, but only for Data Center deployments, and I am afraid we are not at this stage yet.

Alexis Robert
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 9, 2019

Yes you're right, I actually assumed the gzip setting was the recommandation for both Jira and the proxy ... my bad :)

So, for your use case, did you look into a proper cache server like squid ? 

I've also found an article to set up nginx for caching with Jira, maybe it can help you: https://blog.servicerocket.com/adoption/blog/2015/04/setting-up-nginx-as-a-proxy-cache-for-jira

 

Let me know if you find something that works !

 

--Alexis

Suggest an answer

Log in or Sign up to answer