Web Publishing, SEO, CMS, Webserver

Reducing traffic and bandwidth requirements using GZIP and PHP

Today I eventually started optimizing the performance (thereby reducing server load a bit). It appeared some pages of my larger websites have grown to round about 300 kb causing some latency for lower bandwidth visitor. Having a quite good connection myself, I didn't care about that much in the past. But that's ab pity, because it is very simple to add compression to pure PHP-generated content.

SEO for Bing

About Bing

Bing is the latest remake of Microsoft's search engine. Since letdown live.com was closed, people start talking about the new search engine.

Using rel="nofollow" to optimize internal link structure

Google invented a tag called "nofollow" to give webmasters better controll about how a site spreads its link power. In this article I'll describe in detail how this tag works and how you can benefit from it. It contains some secret information about how Google handles links and Nofollow.

Google break-down

This seems to be a very special day. I don't remember if this ever happened to me, but this morning several Google services seem to be broken down for some reason. I'm unable to connect to Adsense or Adwords for about 1 1/2 hour now. The Google search engine and Google Analytics still work, so it's no general Google infrastructure break down.

Why IE7 sucks and FireFox 3 doesn't...

Yesterday I had a really shocking experience. While tweaking the layout and design of my yet largest project, my network connection seemed to become broken and some tools like PhpED and IE7 (latest Internet Explorer of Microsoft) where unable to connect properly. Well, the culprit was not PhpED at all. Maybe it just hung with IE7 because of its IE7 Debug Plugin or something.

Vertical-Align text inside a DIV container with CSS

Text-Align, the simple case

Aligning text in a DIV container ist very simple done by the following code:

  <div style="width:100%; text-align:center;">Centered Text</div>

Vertical-Align - the complicated case

Vertical alignment of text in a DIV is a little bit more complicated, because the usual way used for table cells doesn't work with DIVs.

The code below doesn't work:

  <div style="height:3em; vertical-align:middle;">
    Not centered vertically!
  </div>

Smarty templates and PHP iterators

Smarty templates are a very useful tool and I'm addicted to Smarty for a couple of years now. All projects I did use Smarty templates. Now it's 2009 and PHP 5.2 is stable and has a good performance. Therefore I decided to use any of PHP 5's features when they come along my way.

Recently, Iterators came to close and I had to implement one. It's usefull for proxying and also for dynamically presenting views of lists. Therefore my implementation looks like:

class Foo {
  var $childs;
 

Using commas in SEO friendly URLs

Just a quick note about comma seperation in a URL:

The standards state a comma (,) character is reserved for special use in URLs, whilst they don't tell what the special use might be. As well the practical use of comma in URLs is much less strict. Many CMS use comma seperated lists in URLs to pass information to the URL target.

Proxy pattern with PHP 5

PHP from version 5 on provides reasonable object support. Well the language is not really object-oriented, but hey, it's a scripting language!

Recently I had the chance to implement the proxy pattern (one of my favourite design patterns) in PHP. My goal was to make object relations more dynamical. Lets start from a simple assumption of two kinds of objects:

class Parent {
 var $ID;
 var $Child;
}
 
class Child {
 var $ID;
 var $Parent;
}

As you'll notice, both classes reference each other. Parent points at Child and Child points to Parent.

How to remove white space underline at end of links...

This is a very short and quick solution for web designers. The situation of today is an style link becomes trashed when having any kind of white spaces just before the closing

Imagine a link like:

<a title="example">
 example
</a>

will result in a display like:
example 

This is a bug of all browsers I know, but there is a quick PHP fix for it:

$html_source = preg_replace( "/\s+<\/a>/i", "</a>", $html_source );