minimal http response headers

3,308 views
Skip to first unread message

zombie

unread,
Mar 15, 2009, 1:32:55 AM3/15/09
to Google App Engine
Does anyone know what is the minimum amount of data that the appengine
http response can return?

I need the ***absolute*** minimum, counting both headers and data.
Actually, I don't even plan to return any data, just 1 bit of
information through (custom) status response codes like "201" (for OK)
or "501" (for ERR).

(as to why, short answer: GPRS transfer charged per byte, lots of
requests)

And since this is my custom app doing requests, I will not even use
GET request, probably just HEAD, or even PUT (or anything that will
help return the smallest amount of data). Also, any caching method
(that could help) is possible for me (IfModified/ETag?).

Doing a normal "GET / HTTP/1.0" request on some appengine app, I get
this response headers:

HTTP/1.0 200 OK
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache
Date: Sun, 15 Mar 2009 05:00:48 GMT
Server: Google Frontend
Content-Length: 2906
Connection: Close

I can see from appengine documentation that you can't modify Content-
Length, Date and Server fields, so I suppose they can't be disabled
either. Is there a way to disable them, possibly using custom HTTP
commands (HEAD/PUT?)?

Or just a simple redirection maybe? Are all those headers sent back
when your script does a simple HTTP 302 redirect?


Thanks in advance
Tomislav Jovanovic

Ryan Lamansky

unread,
Mar 15, 2009, 1:15:17 PM3/15/09
to Google App Engine
Basically all the headers come back regardless of the type of
request. You can discover this yourself via experimentation (sending
HTTP requests by telnet to port 80).

If you're in an extremely bandwidth-constrained environment, try to
group your requests together to minimize the per-request overhead.

-Ryan

Jarek Zgoda

unread,
Mar 16, 2009, 10:33:49 AM3/16/09
to Google App Engine
Nothing forces you to use WebApp framework with its request/response
objects - WebOb is available already (afaik, in WebApp request is
WebOb request, but response is not a subclass of WebOb response),
Werkzeug works too.
Reply all
Reply to author
Forward
0 new messages