#25590 closed defect (fixed)

Add a configuration line to the consensus-health Apache config

Reported by: tom Owned by: tpa
Priority: Medium Milestone:
Component: Internal Services/Tor Sysadmin Team Version:
Severity: Normal Keywords:
Cc: Actual Points:
Parent ID: #25588 Points:
Reviewer: Sponsor:

Description

SetEnvIf X-Requested-With XMLHttpRequest no-gzip

#25588 is a feature to allow users to load individual relay details on the index page; without having to load the entire detailed page. It uses Range requests.

consensus-health.torproject.org currently supports Range requests, so no configuration needed for that:

curl -H "Range: bytes=0-100" -H "X-Requested-With: XMLHttpRequest" https://consensus-health.torproject.org

But using compression in conjunction with Range requests confuses Apache. (Should the Range be before the compression, or after? Apparently it's never been decided.)

So for AJAX requests we need to disable compression. The only thing making AJAX requests to consensus-health is my new feature so we're not going to be sending a ton of data uncompressed.

Once the configuration is correct, the following two commands will have the same output:

curl -H "Range: bytes=0-100" -H "X-Requested-With: XMLHttpRequest" https://consensus-health.torproject.org
curl -H "Range: bytes=0-100" -H "X-Requested-With: XMLHttpRequest" https://consensus-health.torproject.org --compressed

Child Tickets

Change History (3)

comment:1 Changed 15 months ago by weasel

I'm not (yet) convinced this is sane.

Having this application specific case handling in the apache config seems unsmart and certainly like it can't possibly scale.

Should the applications that make these requests say they don't want compression if they really don't want compression?

Hmm.

comment:2 in reply to:  1 Changed 15 months ago by tom

Replying to weasel:

Should the applications that make these requests say they don't want compression if they really don't want compression?

Hmm.

No, unfortunately you can't specify in an AJAX request from the browser whether or not you want compression enabled.

comment:3 Changed 15 months ago by weasel

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.