google app engine - Should I use a GZIP compression middleware or not? -


having worked django, i've seen people tend reccommend use of gzip middleware compress html pages.

however, wsgi v1.0 specification tells us:

(note: applications , middleware must not apply kind of transfer-encoding output, such chunking or gzipping; "hop-by-hop" operations, these encodings province of actual web server/gateway. see other http features below, more details.)

this suggests compression should left server/gateway. makes sense, server faster in doing that. also, might prefer sdch on gzip, modern chrome/chromium browsers support it.

so question remains, should use middleware compress responses or not? specifically, right choice google app engine?

edit:

the pylons book contains example gzip middleware.

i didn't mention framework of choice pyramid (ex-repoze.bfg).

app engine already does compress content, if client supports it.

if client sends http headers request indicating client can accept compressed (gzipped) content, app engine compresses response data automatically , attaches appropriate response headers. uses both accept-encoding , user-agent request headers determine if client can reliably receive compressed responses. custom clients can force content compressed specifying both accept-encoding , user-agent headers value of "gzip".


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -