Browsing Category: "optimization"

Google webmaster tools

Great Ideas, Google, SEO, optimization, Web Development June 18th, 2008

There’s no easier way to add your site to Google index than using Google Webmaster tools.

The steps are simple: You create an account (if you don’t have one), add your site and verify it.

There are 2 ways to verify the site, you can either add a meta tag with one code that the tool will provide you or you can create a .html file with the code.

Once your site is verified, you will access usuable information such as:

  • If your site is indexed (surprising enough, I had one that wasn’t)
  • How Google webcrawler see your site
  • Adding a site map only for helping the web crawlers (more known as Google bot)
  • Keywords and phrases most searched
  • Manage how fast the web crawler will search for your site (I’m still trying to understand how this works and why should affect your index position)
  • Add tabs on your iGoogle with all information for each site you manage
  • some other stuff that might be useful

I do recommend to use Google Analytics and AdWords together with the info from the webmaster tools to get more traffic to your site.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Breaking down SEO nice urls

Apache, Google, SEO, optimization, Linux April 24th, 2008

Every developer knows that Apache rewrites rules to break down urls with lot’s of query strings are one of the most efficient ways to  optimize your site  for search engines.

Recently I have to create a series or rules to work with a extensive directory list in one site and here are some of the things that you can use when creating your rules.

1. If you are working with a directory listing or if you will use an address as part of the search on the query string, then, when creating the url create in a ordered manner way, but at the title, write it in back order way.

Think like this:  When you search for a product or service on a search engine you will probably do service + city + state, right!? Then writing the title with service, city and state will increase the chances that you have to appear on the first pages on the search engine results.

2. When creating the rules be sure to put them in a logic order way. Apache will not understand too similar rules pointing to different pages if one contains less requirements than the second.

Consider this:

1st. RewriteRule ^directory/([A-Za-z+]+)/([A-Za-z]+)/([A-Za-z+].+)/?$ /list.php?&c=$1&s=$2&v=$3 [NC]

2nd. RewriteRule ^directory/([A-Za-z+]+)/c/([A-Za-z+].+)/user/([A-Za-z+,.]+)/([0-9]+)/?$ /detail.php?&c=$1&v=$2&name=$3&id=$4 [NC]

With this disposition, apache will not understand the second rule, even knowing that the rule is there, because the first rule requirements will became true before the second, but if you invert the rules, apache will understand both, since the second rule has more requirements than the first and not all the requirements where matched.

3. Try to create a rule that is a catch all for something that you are not expecting. This will avoid the user and search engine view something that is not supposed to be there.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Looping into arrays

optimization, Web Development, PHP March 19th, 2008

There are some sites that try to do a benchmark over FOREACH and the FOR statement and not always they give a good position about it.

To understand which one will be the faster one, is simple:

FOREACH will automatically points the array pointer to the beginning of the array and will create a copy of the array to perform the loop and will increment the pointer in one always. FOR does not, but the FOR statement will check the 3 conditions that you have used on it.

Looping into arrays you have 3 conditions with the FOR statement.

- Where the pointer starts.
- Until when you want to perform the loop.
- and how the pointer will be incremented.

Considering that you have 3 scalar conditions, the FOR statement will be much faster than the FOREACH statement.

Ex.

$array = explode(’ ‘,’ Consider the following examples. All of them display the numbers 1 through 10:’);

foreach($array as $key => $value) {
if($key > 0) {
echo ‘ ‘;

}
echo $value;

}

$size = sizeof($array);
for($key = 0; $key < $size; ++$key) {
if($key > 0) {
echo ‘ ‘;
}
echo $array[$key];
}

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Optimizing MySQL

MySQL, optimization, Web Development October 25th, 2007

I was looking for some functions for using in MySQL and I found this great article about optimizing the server that runs MySQL. It shows useful information including what type of API you should use for developing with the database.

Optimizing MySQL

One of the things that the article references is the virtual links for disks on MySQL. I did a small research and I found this other article that talks about this.

http://dev.mysql.com/doc/refman/5.1/en/symbolic-links.html

Save 5 minutes to read this, have a lot of useful information for the daily basis.

File: Presentation about Optimizing MySQL

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

PHP performance benchmark

optimization, Web Development, PHP October 22nd, 2007

I have always tried to figure out which loop statement is faster and searching for that I have found a good benchmark test with this information.

Check it out….

http://www.php.lt/benchmark/phpbench.php

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Performance trick with PHP

optimization, Web Development, PHP October 19th, 2007

I was reading some articles - Brazil - about PHP performance and some coders consider to use the following code to find bottlenecks. The reason of that is because a page can be fast processed but very slow loaded. This script will output the the time that the server took to process the page and with Yslow - Firefox plugin - you can check how long it took to load the page.

On the start of the page include the code:

list($usec, $sec) = explode(’ ‘, microtime());
$script_start = (float) $sec + (float) $usec;

On the end of the page include this code:

list($usec, $sec) = explode(’ ‘, microtime());
$script_end = (float) $sec + (float) $usec;
$elapsed_time = round($script_end - $script_start, 5);
echo $elapsed_time;

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

42 Tips for Speeding Up PHP

optimization, PHP October 16th, 2007

Great list of tips / hacks for optimizing PHP for speed.    Here are a couple that caught my eye:

  1. $row[’id’] is 7 times faster than $row[id]
  2. Incrementing an undefined local variable is 9-10 times slower than a pre-initialized one.
  3. In some instance you can improve the speed of your code by using an isset() trick.
    Ex.
    if (strlen($foo) < 5) { echo “Foo is too short”; }
    vs.
    if (!isset($foo{5})) { echo “Foo is too short”; }

http://webguy.antaramedia.com/blog/?p=22

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
blank