Tuesday, July 1st, 2008
When a keep-alive request is granted the established socket is kept open after each keep-alive
response. Note that a keep-alive response is only possible when the response includes a
content-length header.
request 1
request 2
request 3
request 4
20 bytes
120 bytes
60 bytes
?? bytes
You cannot rely on the keep-alive feature for any sort of application-level session state maintenance.
Using Output Buffering to get content-length
<?php
ob_start();
echo “Your Data”;
$l = ob_get_length();
Header(”Content-length: $l”);
ob_end_flush();
?>
You will have to weigh the trade-off between the extra cpu and memory that output buffering takes
against the increased effciency of being able to use keep-alive connections for your dynamic pages.
Tags: Alive, CPU, effciency, established, header, includes, Keep, PHP, REQUEST, response, socket
Posted in PHP | No Comments »
Monday, June 30th, 2008
Client/Server Request/Response
HTTP is a simple client/server protocol with stateless request/response sequences.
The Client HTTP Request
7 possible HTTP 1.1 request types: GET, PUT, POST, DELETE, HEAD, OPTIONS and TRACE.
Any number of HTTP headers can accompany a request.
GET /filename.php HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
Accept-Charset: iso-8859-1,*,utf-8
Accept-Encoding: gzip
Accept-Language: en
Connection: Keep-Alive
Host: localhost
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.5-pre4 i686; Nav)
The Server HTTP Response
HTTP/1.1 200 OK
Date: Mon, 21 May 2001 17:01:51 GMT
Server: Apache/1.3.20-dev (Unix) PHP/4.0.7-dev
Last-Modified: Fri, 26 Jan 2001 06:08:38 GMT
ETag: “503d3-50-3a711466″
Accept-Ranges: bytes
Content-Length: 80
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html
Tags: Client, Connection, Delete, get, HEAD, HTTP, Image, Linux, localhost, Options, PHP, post, PUT, REQUEST, response, server, Text, Trace
Posted in PHP | No Comments »
Thursday, June 26th, 2008
* The first thing to do to get high-quality links is to submit your blog and RSS feed to blog search engines and directories.
Start by submitting your blog to all the directories listed on this page:
* Link exchanging with other similarly-themed blogs will help you to form richly interlinked networks or communities.
* If you find an interesting article on another blog, link to it generously. The trackback will become a link back to your blog.
* Lastly posting legitimate comments in response to posts on other blogs will help you get backlinks. Regularly post legitimate comments in similarly-themed blogs with high traffic to get many backlinks.
Tags: backlinks, Directories, directories listed, exchanging, high-quality links, interlinked, legitimate, response, RSS, trackback
Posted in SEO | No Comments »