Skip to content
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

Compress http responses #66

Closed
twagoo opened this issue Mar 14, 2017 · 2 comments
Closed

Compress http responses #66

twagoo opened this issue Mar 14, 2017 · 2 comments
Assignees

Comments

@twagoo
Copy link
Member

twagoo commented Mar 14, 2017

Follow up of #28: compress http responses to reduce response time. This can be achieved through the Tomcat configuration, as described in this article as well as the official documentation.

Example server.xml snippet (from the article, not tailored for the VLO!):

<Connector compressableMimeType="text/html,text/xml,text/css,text/javascript, application/x-javascript,application/javascript"
compression="on"
compressionMinSize="128"
connectionTimeout="20000"
noCompressionUserAgents="gozilla, traviata"
port="8080"
redirectPort="8443" protocol="HTTP/1.1" />

The admin(s) should check wether this works as intended with the Apache and/or nginx proxies.

See Component Registry #15 for a similar proposal.

@twagoo
Copy link
Member Author

twagoo commented Mar 20, 2017

I have been successful on alpha-vlo.clarin.eu (Scientific Linux 7) with the following additions to httpd.conf:

LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule mime_module modules/mod_mime.so

###### gzip compression #########
<IfModule mod_mime.c>
 AddType application/x-javascript .js
 AddType text/css .css
</IfModule>
<IfModule mod_deflate.c>
 AddOutputFilterByType DEFLATE text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/javascript
 <IfModule mod_setenvif.c>
  BrowserMatch ^Mozilla/4 gzip-only-text/html
  BrowserMatch ^Mozilla/4\.0[678] no-gzip
  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
 </IfModule>
 <IfModule mod_headers.c>
  Header append Vary User-Agent env=!dont-vary
 </IfModule>
</IfModule>

This approach should also work on vlo.clarin.eu (CentOS).

On beta, which uses nginx, it should be as easy as following this guide. Make sure to use the same list of mime types:

text/css application/x-javascript text/x-component text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/javascript

and that CSS and JS files are matched with the right mime type.

@twagoo twagoo modified the milestone: VLO-4.2 Apr 7, 2017
@twagoo twagoo self-assigned this Apr 10, 2017
@twagoo twagoo added the bug label Apr 12, 2017
@twagoo twagoo removed the bug label Jun 13, 2017
@twagoo twagoo removed this from the VLO-4.2 milestone Jun 13, 2017
@twagoo
Copy link
Member Author

twagoo commented Jun 3, 2019

For docker compose based deployment scenarios, nginx proxy handles this. See https://gitlab.com/CLARIN-ERIC/compose_vlo/issues/7

@twagoo twagoo closed this as completed Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants