Posts Tagged ‘header’

Php:Keep-Alive

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.

PHP: Prevent PHP script Caching

Monday, June 30th, 2008

// prevent caching
header(”Expires: Sat, 01 Jan 2000 00:00:00 GMT”);
header(”Last-Modified: “.gmdate(”D, d M Y H:i:s”).” GMT”);
header(”Cache-Control: post-check=0, pre-check=0″,false);
session_cache_limiter();
session_start();

Use your primary key phrase in your blog header tags and the title of your posts

Wednesday, June 25th, 2008

f your primary key phrase is “business blogging” make sure that the word business, or blogging, or both, appear in your blog headers (the H1 or H2 tags) as well as the title of each of your posts.

Most blogging software will take the keywords in your post title and put them into the file name of the permalink posts it creates.

For example, if you have a blog on Blogger and title your post “Search Engine Optimization For Blogs”, Blogger will automatically create a page with your post and name the file “search-engine-optimization-for-blogs.html” or something similar.

With other server-side software like Wordpress and Movable Type, you may require the mod_rewrite command to save the title of your entries as a permalink.

Use your primary key phrase in your blog header tags and the title of your posts

Thursday, June 19th, 2008

If your primary key phrase is “business blogging” make sure that the word business, or blogging, or both, appear in your blog headers (the H1 or H2 tags) as well as the title of each of your posts.

Most blogging software will take the keywords in your post title and put them into the file name of the permalink posts it creates.

For example, if you have a blog on Blogger and title your post “Search Engine Optimization For Blogs”, Blogger will automatically create a page with your post and name the file “search-engine-optimization-for-blogs.html” or something similar.

With other server-side software like Wordpress and Movable Type, you may require the mod_rewrite command to save the title of your entries as a permalink.