HTTP

HyperText Transfer Protocol လို႕ ေခၚတဲ့ HTTP ဟာ Communication Protocol တစ္ခုျဖစ္ပါတယ္... ဒီ Protocol က Client နဲ႕ Server အၾကား Web Document ကို Transfer လုပ္တဲ့ေနရာမွာ လိုက္နာရမယ့္ စံသတ္မွတ္ခ်က္ေတြကို ခ်မွတ္ထားတဲ့ Protocol ျဖစ္ပါတယ္... HTTP Protocol အတြက္ စံေတြကို World Wide Web Consortium (W3C) က ခ်မွတ္ထားေပးပါတယ္...

Client

Client Server Computing မွာ Client ရဲ႕ အဓိပၸါယ္ကို အရွင္းဆံုး ဖြင့္ဆိုရမယ္ဆိုရင္ "Client ဆိုတာ ေတာင္းမယ့္သူ" ျဖစ္ပါတယ္... World Wide Web (WWW) မွာ Client ဆိုတာဟာ End User အသံုးျပဳေနတဲ့ Web Document ကို ေတာင္းမယ့္ Application (ဥပမာ။ ။ Web Browser) ပဲ ျဖစ္ပါတယ္... Web Document ေတြ ေတာင္းတာကို Request လုပ္တယ္လို႕ ေခၚပါတယ္...

Server

Client Server Computing မွာ Server ရဲ႕ အဓိပၸါယ္ကို အရွင္းဆံုး ဖြင့္ဆိုရမယ္ဆိုရင္ "Server ဆိုတာ ေပးမယ့္သူ" ျဖစ္ပါတယ္... Web Document ေတြကို Store လုပ္ထားတဲ့ Computer တစ္လံုးေပၚမွာ Client ကေတာင္းတဲ့အခါ ေပးဖို႕အတြက္ စီမံေပးတဲ့ Application တစ္မ်ိဳးကို Web Server လို႕ေခၚပါတယ္... Client က ေတာင္းတဲ့အခါ ေပးတဲ့ လုပ္ငန္းစဥ္ကို Respond လုပ္တယ္လို႕ ေခၚပါတယ္...

Request & Respond Sample
HTTP / 1.1 က သတ္မွတ္ထားတဲ့ ျပည့္စံုတဲ့ Client Request တစ္ခုရဲ႕ နမူနာက ေအာက္ပါအတိုင္းျဖစ္ပါတယ္...
GET /index.html HTTP/1.1
Host: www.example.com
HTTP / 1.1 က သတ္မွတ္ထားတဲ့ ျပည့္စံုတဲ့ Server Respond တစ္ခုရဲ႕ နမူနာက ေအာက္ပါအတိုင္း ျဖစ္ပါတယ္...
HTTP/1.1 200 OK
Date: Mon, 23 May 2008 22:38:34 GMT
Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2006 23:11:55 GMT
Etag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes
Content-Length: 438
Connection: close
Content-Type: text/html; charset=UTF-8
အထက္က Server Respond ျပန္တဲ့ Information ေတြကို Respond Header လို႕ေခၚပါတယ္... Server က ျပန္ေပးတဲ့ Respond Header ကိုၾကည့္ျပီး Client ျဖစ္တဲ့ Web Browser က သင့္ေတာ္သလို အလုပ္လုပ္ပါတယ္...

ဥပမာ Respond Header မွာ 200 OK လို႕မပါပဲ 404 Not Found လို႕ပါရင္ Web Browser က User ကို Page Not Found Error Message ကို ျပေပးပါတယ္... ေနာက္ဥပမာတစ္ခုက Respond Header မွာ Content-Type: text/html လို႕ပါရင္ Web Page ကို Browser ထဲမွာ ျပေပးမွာ ျဖစ္ျပီး Content-Type: application/x-rar လို႔ပါရင္ေတာ့ အဲ့ဒီ File Type ကို Browser က မျပႏုိင္တဲ့အတြက္ ျပဖို႕မၾကိဳးစားပဲ Download ေပးမွာ ျဖစ္ပါတယ္... ဒါေတြဟာ Web Browser ေတြက Respond Header ကို ၾကည့္ျပီး လုပ္သြားမယ့္ အလုပ္မ်ားထဲမွ အခ်ိဳ႕ျဖစ္ပါတယ္...

Web Cache
Web Page တစ္ခုကို ပထမတစ္ၾကိမ္ Browse လုပ္ထားျပီးရင္ ေနာက္တစ္ၾကိမ္ ျပန္ေခၚေတာ့ ပိုျမန္တာကို သတိထားမိပါသလား..? Web Cache ဆိုတာဟာ Bandwidth သက္သာေစဖို႕နဲ႕ Server Load သက္သာေစဖို႕ Web Document ေတြရဲ႕ Copy ကို Web Browser က သိမ္းထားတာကို ေခၚတာျဖစ္ပါတယ္...

Web Cache ကို Control လုပ္ပံု သံုးမ်ိဳးရွိေပမယ့္ နားလည္လြယ္မယ့္ ဥပမာတစ္ခုေလာက္ ၾကည့္ရေအာင္ပါ... အထက္က Respond Header မွာ အဲ့ဒီ Document ရဲ႕ Last-Modified Date ပါလာပါတယ္... Web Browser က Server ကို Request လုပ္တဲ့ေနရာမွာ Condition ေလးတစ္ခုထည့္ျပီး Request လုပ္ေလ့ရွိပါတယ္... Browser က Server ကို ေျပာမယ့္ပံုစံက ဒီလိုျဖစ္ပါတယ္...
index.html ကို Wed, 08 Jan 2006 23:11:55 GMT ေနာက္ပိုင္း ျပင္ထားတယ္ဆိုရင္ ငါ့ကိုေပးကြာ... မျပင္ဘူးဆိုရင္ေတာ့ ေပးမေနနဲ႕... ငါသိမ္းထားတဲ့ Copy နဲ႕ပဲ အလုပ္လုပ္လိုက္ေတာ့မယ္...
ဒီေတာ့ Web Server က Document ရဲ႕ Last-Modified Date ကိုၾကည့္လိုက္ျပီး Update မျဖစ္ရင္ မပို႕ေတာ့ပါဘူး... Browser က သူ႕ရဲ႕ Cache ထဲမွာ သိမ္းထားတဲ့ Copy ကိုပဲ End-User ကုိ ျပေပးပါတယ္... File ကို Transfer မလုပ္ေတာ့တဲ့အတြက္ Bandwidth သက္သာသြားသလို ပိုလည္း ျမန္သြားပါတယ္...

HTTP / 1.2
အဲ့ဒီ HTTP / 1.1 ရဲ႕ Caching ဟာ သက္ဆုိင္ရာ Domain တစ္ခုအတြက္ပဲ အလုပ္လုပ္ပါတယ္... Global Cache ရရင္ ဘယ္လိုေနမလဲ... ကြ်န္ေတာ္ ျဖစ္ေစခ်င္တာက ဒီလိုပါ...

ကြ်န္ေတာ္က jquery.com ကို တစ္ခါ Browser လုပ္လုိက္ပါတယ္... ဒါေၾကာင့္ အဲ့ဒီ Site မွာ သံုးထားတဲ့ jquery.js ကို ကြ်န္ေတာ့္ Browser က သိမ္းထားပါတယ္... ဒါေၾကာင့္ ေနာက္တစ္ခါ jquery.com ကို ထပ္၀င္တဲ့အခါ jquery.js ကို ထပ္ျပီး Load လုပ္စရာမလိုေတာ့ပါဘူး... ဒါေပမယ့္ အဲ့ဒီ jquery.js နဲ႕ ခြ်တ္စြတ္တူတဲ့ jquery.js ကိုသံုးထားတဲ့ ေနာက္ Site တစ္ခုျဖစ္တဲ့ noupe.com ကို Browser လုပ္တဲ့အခါမွာေတာ့ Domain မတူေတာ့တဲ့အတြက္ noupe.com က jquery.js ကို ထပ္ဆြဲပါတယ္... အမွန္ဆို ကြ်န္ေတာ့္ Browser မွာ jquery.js ကရွိျပီးသားပါ... ထပ္မဆြဲေတာ့ရင္ ဘယ္ေလာက္ေကာင္းမလဲ...

Proposal
ေခါင္းစဥ္မွာ HTTP / 1.2 - Draft Proposal လို႕ေျပာထားေပမယ့္ Global Cache ပံုစံျဖစ္လာေစဖို႕ ဘယ္လို လုပ္ရမလဲမသိပါဘူး... မိတ္ေဆြတို႕ဆီက အၾကံေတာင္းမယ္လို႕ ရည္ရြယ္ျပီး ဒီလို ေခါင္းစဥ္ေပးထားတာျဖစ္ပါတယ္... ဒါေၾကာင့္ ေက်းဇူးျပဳျပီး ဒီကိစၥကို ၀ိုင္းျပီး Brain Strom လုပ္ေပးေစခ်င္ပါတယ္... ျဖစ္ႏုိင္ေခ်ရွိတဲ့ Solution မ်ား ေတြ႕မိရင္ ေက်းဇူးျပဳျပီး ဒီေနရာမွာ ေျပာေပးၾကေစလိုပါတယ္...

အဲ... ဒီကိစၥကို W3C ကို တင္ျပျပီး အမွန္တစ္ကယ္ Propose လုပ္မယ္လို႕ေတာ့ မရည္ရြယ္ပါဘူး... ပိုမိုျမန္ဆန္တဲ့ အင္တာနက္ ျဖစ္လာေစဖို႕ နည္းလမ္းေလးတစ္ခုကို စဥ္းစားလိုလို႕သာ ဒီ Post ကို တင္ရျခင္းျဖစ္ပါတယ္...

ေက်းဇူး...
[ Ei Maung ]

Views: 23

Tags: http, www

Comment

You need to be a member of MyanmarITPro - A Social Network for Myanmar IT Professionals to add comments!

Join MyanmarITPro - A Social Network for Myanmar IT Professionals

Comment by ဗုိက္ကေလး on January 8, 2010 at 9:54am
ေကာင္းတယ္ဗ်ာ
ဖတ္ကတာေတာ႔
္firefox plug in
လုပ္ရင္ေတာ႔ပုိေကာင္းတယ္ဗ်ာ
ေက်းဇူးတင္ပါတယ္ဗ်ာ
Comment by Mark on January 1, 2010 at 4:58pm
>> ps: Wikipedai said that MD5 is not collision resistant...

not only MD5, any others algorithms like sha1, aes256 are not unique too, its just impossible.
Comment by Mark on January 1, 2010 at 4:56pm
yes, ei mg and lionslayer, i didnt really look at the digits, its 16 bytes, 128bits
Comment by Ei Maung on January 1, 2010 at 3:39pm
@Lionslayer
>> MD5 checksum ကုိ Download လုပ္ျပီးသားဖုိင္ ကြက္တိ မွန္မမွန္ စစ္ဖုိ႕ သုံးတာ မဟုတ္လား။
Not about checksum. Only MD5. MD5 and other cryptography techniques are not only to calculate download file size.

For Example:
MD5("The quick brown fox jumps over the lazy dog.") = e4d909c290d0fb1ca068ffaddf22cbd0
MD5("The quick brown fox jumps over the lazy dog") = 9e107d9d372bb6826bd81d3542a419d6

And MD5 is 128 bits (=16 bytes). I thought Mark meant 32 digits.

But your are right in un-necessary server load problem...

ps: Wikipedai said that MD5 is not collision resistant...
Comment by Mark on January 1, 2010 at 1:46pm
>>> we can have unique hash by summing up Content+Modified-Date+File-Name

Its impossible to make unique hash, your hash is only 32 bytes, 0 bytes is 32 bytes, 1 M also 32 bytes, 10 M also 32 bytes, how can you make it unique?
Comment by Mark on January 1, 2010 at 1:43pm
Yes, wikipedia says, Its a blank string too, but It does not mean non-blank strings are safe.
Comment by Ei Maung on January 1, 2010 at 1:32pm
@Mark
>> This hash got 452,000 hits in google, d41d8cd98f00b204e9800998ecf8427e,
>> do you really believe those hash will not collide?
I'm just not sure. And yes, that hash would hit that much because that is a md5 hash for a blank string... :D

@Htoo Tay Zar
There were some plugins for integrated jQuery. But, I'm not sure, we can save bandwidth by requesting jquery.js by those plugins.

@Ko awm
Thanks for the detail discussion...

@Ko Ravi
I just thought, we can have unique hash by summing up Content+Modified-Date+File-Name and other meta data. Thanks for the explanation and reference...

@Sean Lin
Google CDN is great and I found they provide almost all of JS Frameworks. It would be nice if everybody use that...

Thanks you to all and Happy New Year!
Comment by Mark on January 1, 2010 at 1:13am
@EiMg

This hash got 452,000 hits in google, d41d8cd98f00b204e9800998ecf8427e, do you really believe those hash will not collide?

@Sean Lin
Yes, Thats correct, those are all CDN, those are owned by each companies and using for their services only right?
Comment by Sean Lin on December 31, 2009 at 7:25pm
@Mark

timg.com, yimg.com and sstatic.net are all CDN (Content Delivery Network) backed links for them to store media for faster loading...
Comment by Htoo Tay Zar on December 31, 2009 at 6:22pm
အရင္ကေတာ့ သတင္းဖတ္မိေသးတယ္ Firefox က jQuery ကို ထည့္ေပးမယ္ေၿပာတယ္.. အခုေတာ့ မၾကားၿပန္ဘူး.. ထည့္ေပးလဲ browsers တိုင္းထည့္မွပဲ အဆင္ေၿပမွာ မဟုတ္ရင္ေတာ့ hack / detect လုပ္ရမွာနဲ႔ မထူးပါဘူး... ဒါမွမဟုတ္ ကိုအိေမာင္ Firefox plug in ေရးေပးပါလားဗ်ာ.. jQuery, Mootools လို js framework ေတြ download လုပ္စရာမလိုေတာ့ေအာင္ ဟီးဟီး အခြ်န္နဲ႔ မတာပါ firefox မွာ အဲဒီ inject လုပ္ၿပီး ထည့္လို႔ရေအာင္ plug in ေတြ လုပ္လို႔ ရလားလဲ မသိဘူး..

Latest Activity

Nay Lin Kyaw replied to ဟိန္းထက္'s discussion ကူညီပါ.........။
45 minutes ago
GaaRa posted a discussion
1 hour ago
Okisan and Kyaw Thu are now friends
2 hours ago
Phyu Sin Kyaw replied to Aung Than U's discussion Search Engine မွာရွာရင္ ကၽႊန္ေတာ္တို႔ ကုမၼဏီရဲ႕ ၀က္ဆိုဒ္ကို အေပၚဆံုးမွာ ျမင္ခ်င္လို႔ပါ... Asp.net နဲ႔ ေရးထားတဲ႔ ဆိုဒ္ပါ..သိရင္ ေျပာျပေပးၾကပါ senior မ်ားခင္ဗ်ာ.....
2 hours ago
Jake added a discussion to the group Networking
2 hours ago
Phyu Sin Kyaw replied to Wayne's discussion [ Moved ] Skype Credit Sale
3 hours ago
D0743M0N replied to D0743M0N's discussion What is the best way to decide limitation of broadcast level in the group Networking
3 hours ago
DaKyat replied to D0743M0N's discussion What is the best way to decide limitation of broadcast level in the group Networking
3 hours ago
D0743M0N replied to D0743M0N's discussion What is the best way to decide limitation of broadcast level in the group Networking
3 hours ago
Min Lwin posted a status
"for B Shell beginners. http://ning.it/M8TDWR"
8 hours ago
yenaungkyaw updated their profile
8 hours ago
yenaungkyaw liked ဟိန္းထက္ေအာင္'s blog post Window 8 and Window7/8 Phone
8 hours ago
Ko Nge commented on Ko Nge's blog post ေဖ့ဘြတ္ထဲက ၀င္ေငြရွာနည္း (၁၂)မ်ိဳး
10 hours ago
Ko Nge updated their profile
10 hours ago
John Moe replied to D0743M0N's discussion What is the best way to decide limitation of broadcast level in the group Networking
13 hours ago
Win Min Tun left a comment for Ko Nge
16 hours ago

© 2012   Created by Ko Chit.

Badges  |  Report an Issue  |  Terms of Service