Wednesday, February 4, 2009

Detecting web-crawlers using cookies

This is how I figured out to split incoming traffic into three branches:
1) cache: web crawlers
2) browse: human users that just quickly browse the pages
3) active: human users that actively use the website

Let ActiveKey and BrowserKey be two fixed arbitrary strings.

This is the algorithm:
1. place in a header of all pages a bit of javascript, this javascript does:
1.1 check if browser knows a cookie by name of SID
1.1.1 if it doesn't have one, set one using javascript to a
value BrowserKey+RandomNumber, and
1.1.2 reload the page using javascript window.reload() call
1.2 if it does have it, just leave the page as is

This separates all web crawlers from all human users. Web crawlers are all the ones that don't send a cookie with name SID that contains a substring BrowserKey

2. If a user clicks a button and starts to use the website as an application (for example, puts products into a shopping cart), then the handler of all button clicks go through the same code that changes the state:
2.1. Change the value of the SID cookie to a string of the form ActiveKey+RandomNumber
2.2 Any ajax request or page navigation will now pass this cookie too automatically
This step separated users in category (2) and (3).

What is the point ? The point is that web crawlers can get older cache content. A site with many pages can serve the bots from pregenerated cached files, giving fast response. The web-crawlers can be served by another server altogether.

Also, users that want fast browsing experience, can be served by a separate server. etc...

10 comments:

Anonymous said...

T
茶葉

製茶廠直銷,提供線上訂購高級茶葉禮盒
阿里山高山茶葉、大禹嶺高山茶葉、梨山高山茶葉、杉林溪高山茶葉、凍頂烏龍
高山茶、烏龍茶、茶葉禮盒、綠茶、鐵觀音、花茶
各種茶葉介紹,茶葉製作過程,茶葉挑選,水質選擇,茶葉特色介紹等資訊。


p

Anonymous said...

H
a片

av片

av女優

洪爺

a片下載

日本a片

色情a片

a片



i

Anonymous said...

S
a片

av片

av女優

洪爺

a片下載

日本a片

色情a片

a片

a383

s383









1

f

Anonymous said...

T
a片

av片

av女優

洪爺

a片下載

日本a片

色情a片
6









2

y

Anonymous said...

W
O
歡迎蒞臨信合美集團全球資訊網 松山信合美眼科‧三民信合美整形外科/皮膚科/醫學美容‧板橋信合美... 松山信合美眼科‧三民信合美整形外科/皮膚科/醫學美容‧板橋信合美眼科 Copyright c2008 Hsin Ho Mei Group. All rights reserved. ...
信合美

仁友信合美


m








1

a

Anonymous said...

O
Q
a片

av片

av女優

洪爺

a片下載

日本a片

色情a片

洪爺


j

dfhgdfhdhtfshjfdhfgjj fgfgj fgh h fghgggh hdshdfh






7

b

Anonymous said...

G
EA片-史上最強最新線上A片收看頻道,成人影音光碟。 ... A片-AV女優 警告啟事: ... 絕瀏覽,且願接受本站內影音內容及各項條款。 ... 提供A片線上高畫質直播,成人影音光碟VCD DVD,(AV女優,辣妹自拍,熟女,偷拍等.)以 ...

a片

av片

A片-史上最強最新線上A片收看頻道,成人影音光碟。 ... A片-AV女優 警告啟事: ... 絕瀏覽,且願接受本站內影音內容及各項條款。 ... 提供A片線上高畫質直播,成人影音光碟VCD DVD,(AV女優,辣妹自拍,熟女,偷拍等.)以 ...

av女優

洪爺

A片-史上最強最新線上A片收看頻道,成人影音光碟。 ... A片-AV女優 警告啟事: ... 絕瀏覽,且願接受本站內影音內容及各項條款。 ... 提供A片線上高畫質直播,成人影音光碟VCD DVD,(AV女優,辣妹自拍,熟女,偷拍等.)以 ...
a片下載

日本a片

A片-史上最強最新線上A片收看頻道,成人影音光碟。 ... A片-AV女優 警告啟事: ... 絕瀏覽,且願接受本站內影音內容及各項條款。 ... 提供A片線上高畫質直播,成人影音光碟VCD DVD,(AV女優,辣妹自拍,熟女,偷拍等.)以 ...
色情a片

洪爺


y

dfhgdfhdhtfshjfdhfgjj fgfgj fgh h fghgggh hdshdfh






0

i

Anonymous said...

K
VA片-史上最強最新線上A片收看頻道,成人影音光碟。 ... A片-AV女優 警告啟事: ... 絕瀏覽,且願接受本站內影音內容及各項條款。 ... 提供A片線上高畫質直播,成人影音光碟VCD DVD,(AV女優,辣妹自拍,熟女,偷拍等.)以 ...

a片

av片

A片-史上最強最新線上A片收看頻道,成人影音光碟。 ... A片-AV女優 警告啟事: ... 絕瀏覽,且願接受本站內影音內容及各項條款。 ... 提供A片線上高畫質直播,成人影音光碟VCD DVD,(AV女優,辣妹自拍,熟女,偷拍等.)以 ...

av女優

洪爺

A片-史上最強最新線上A片收看頻道,成人影音光碟。 ... A片-AV女優 警告啟事: ... 絕瀏覽,且願接受本站內影音內容及各項條款。 ... 提供A片線上高畫質直播,成人影音光碟VCD DVD,(AV女優,辣妹自拍,熟女,偷拍等.)以 ...
a片下載

日本a片

A片-史上最強最新線上A片收看頻道,成人影音光碟。 ... A片-AV女優 警告啟事: ... 絕瀏覽,且願接受本站內影音內容及各項條款。 ... 提供A片線上高畫質直播,成人影音光碟VCD DVD,(AV女優,辣妹自拍,熟女,偷拍等.)以 ...
色情a片

洪爺


a

dfhgdfhdhtfshjfdhfgjj fgfgj fgh h fghgggh hdshdfh






9

d

Anonymous said...

FD
情趣用品

提供上千種成人商品線上購物服務--專營情趣商品、男女自慰用品、性感睡衣、情趣用品批發、自慰套、SM商品、逼真情趣娃娃、跳蛋、按摩棒、同志用品、TENGA飛機杯..,可線上刷卡及貨到付款。 ... 收到的東西會有情趣用品的字樣嗎? 轉帳之後,如何通知這筆款項是我付的
導航

Unknown said...

Hi,Getting a website designed and build for Web Design Cochin, that is SEO friendly, truly SEO friendly is fairly uncommon.
Most web designers profess they know how to do SEO.Thanks......