[nycphp-talk] http headers & measuring size of string in 'bits'
Eric Rank
erank at isthmus.com
Wed May 5 16:18:11 EDT 2004
Howdy folks,
I'm working on generating a file on the fly by sending headers and echoing
out the content of the file. The trouble is that the php script that does
this makes a database query to retrieve the content, and it seems to cause
problems. Merely echoing out the string if content itself works fine. In
short, the process looks like this:
1. database is queried to retrieve the content based on some variables
passed to the page
2. content is built from the query
3. http headers are sent
4. finally the content is echoed out
for your curiosity, the headers are the following:
header('Content-Disposition: inline; filename="file.m3u"');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
Now, what's interesting is that when the query to the db is limited (eg. "
LIMIT 30") to 30 or less results, it works. Any more, and it doesn't.
My first line of thought is that the connection is dying too quickly
I'm interested in trying out the 'connection: Keep-Alive' header to see if
it does anything, but I'm also thinking that a 'content-length' header might
be interesting. And that is why I am asking about measuring the file size of
a string. content-length expects units in octets (bits / 8).
Is there a way to measure the file size of a string?
Or even better, can anyone illuminate what might be happening?
Thanks,
Eric Rank
More information about the talk
mailing list