all gzipped artifacts are served as text/plain
Open, HighPublic


We compress all our artifacts to save space, which is great. However it seems it breaks mimetypes and everything is served as text/plain. For example, this html:
is served as plain text.

Our current apache rule seems to be this:

<DirectoryMatch "^{{ public_artifacts_dir }}/all/(.+)/task_output/">
    RewriteEngine on

    RewriteCond   "{{ public_artifacts_dir }}/all/$1/task_output/$2.gz"  -f
    RewriteCond   "{{ public_artifacts_dir }}/all/$1/task_output/$2"     !-f
    RewriteRule   "^{{ public_artifacts_dir }}/all/(.+)/task_output/(.*)$"  "{{ public_artifacts_dir }}/all/$1/task_output/$2.gz"

    # mod_deflate doesnt work as expected for some reason
    # use custom filter instead
    SetOutputFilter gz-to-plain

    # keep the mod_deflate for reference though
    #AddEncoding x-gzip .gz
    #SetOutputFilter INFLATE
    #ForceType text/plain

I guess SetOutputFilter gz-to-plain is to blame, but I'm not familiar with it.

One solution is to fix this properly (so that mimetypes are respected). A fallback option is to compress only our logs and not task artifacts, but that would need T880 to be solved first.

kparal created this task.Jan 18 2017, 1:26 PM
mkrizek raised the priority of this task from "Normal" to "High".Apr 20 2017, 11:24 AM
mkrizek claimed this task.

We need to fix this sooner than later since this will impact dist git tasks that will have reports in html.

It also affects task-modularity-testing-framework, which reports in html.

So I fixed it for html. It's not pretty but it should do for this particular use case, for now. Leaving open until I come up with a proper solution.

Gzipping disabled on dev for the modularity demo next week.