Evolving to a Faster Web
The web today is an amazing visual and interactive stew, teeming
with images, photos, videos, and whizzy web apps. Some of the web’s most
vivid experiences come from images and videos, from shared photo albums
of family vacations to online video coverage from journalists in war
zones.
It’s a far cry from the simple text and links that started it all.
And it means that every time your browser loads a web page, much more
data and complex code needs to be processed.
How much more, and how much more complex? A few astounding statistics:
- Images and photos now make up about 65% of the information on a typical web page, in terms of bytes per page.
- 35 hours of video are uploaded to YouTube every minute of the day.
(That’s like Hollywood releasing 130,000 new full-length movies every
week, though with less popcorn.)
- JavaScript programs have grown from a few lines to several hundred
kilobytes of source code that must be processed each time a web page or
application loads.
So won’t all these gushing floods of data slow down page loads on the
browser? Will the Internet clog up and turn to molasses soon?
Probably not. Images and photos became commonplace on the web when
computer scientists found ways to compress them into smaller files that
could be sent and downloaded more easily. GIF and JPEG were the most
popular of those early file-compression systems. Meanwhile, plug-ins
were invented to work around the early limitations of HTML so that video
could be embedded and played in web pages.
Looking ahead, the <video> tag in HTML5 makes it easy for
videos to be embedded and played in web pages. Google is also
collaborating with the web community on WebM, an effort to build out a
free, open-source video format that adapts to the computing power and
bandwidth conditions on the web, so quality video can be delivered to a
computer in a farm house in Nebraska or a smart phone in Nairobi.
In the meantime, it’s true that web pages with lots of big photos or
other images can still be very slow to load. That’s why a few engineers
at Google have been experimenting with new ways to compress images even
further while keeping the same image quality and resolution. The early
results? Very promising. They’ve come up with a new image format called
WebP that cuts down the average image file size by 39%.
The engines that run JavaScript code in modern web browsers have
also been redesigned to process code faster than ever before. These fast
JavaScript engines, such as Google Chrome’s V8, are now a core part of
any modern web browser. That means the next generation of fabulously
useful JavaScript-based web applications won’t be hampered by the
complexity of more JavaScript code.
Another technique that modern browsers like Chrome use to fetch and
load web pages much more quickly is called “DNS pre-resolution”. The
process of translating a web address into an IP address through a DNS
lookup, or vice versa, is often called “resolving.” With DNS
pre-resolution, Chrome will simultaneously look up all the other links
on the web page and pre-resolve those links into IP addresses in the
background. So when you do actually click on one of the links on the
page, the browser is ready to take you to the new page instantly. Over
time, Chrome also learns from past visits so that the next time you go
to a web page that you’ve previously visited, Chrome knows to
automatically pre-resolve all the relevant links and elements on the web
page.
Someday, browsers might be able to predict, before the page loads,
not only which links to pre-resolve, but also which website elements
(like images or videos) to pre-fetch ahead of time. That will make the
web even quicker.
Soon enough, we hope, loading new pages on the browser will be as fast as flipping the pages of a picture book.
การพัฒนาเว็บไซต์ให้รวดเร็วยิ่งขึ้น
ทุกวันนี้เว็บเป็นภาพที่น่าตื่นตาตื่นใจ
และสามารถโต้ตอบกับเราได้ประกอบด้วย รูปภาพ, รูปถ่าย, วิดีโอ และ
แอปพลิเคชั่นบนเว็บ
เว็บบางเว็บจะมีสีสันสดใสซึ่งมาจากรูปภาพและวิดีโอจากการแบ่งปันอัลบั้มรูป
ภาพของวันหยุดครอบครัว และ ครอบคลุมนักข่าวที่รายงานข่าวจากสนามรบ
มันเป็นหนทางที่ไกลจากจุดเริ่มต้นจากข้อความง่ายๆ
และลิ้งที่เริ่มต้นทั้งหมด
ซึ่งมันก็หมายความว่าทุกครั้งที่คุณโหลดหน้าเว็บบนเบราว์เซอร์
ข้อมูลและรหัสที่ซับซ้อนจะต้องมีการประมวลผล
แล้วมันยิ่งซับซ้อนมากขึ้นเท่าไร?? ดูได้จากสถิติที่น่าสนใจ
- ปัจจุบันรูปภาพและรูปถ่ายประกอบด้วยประมาณ 65% ของข้อมูลบนตัวอย่างในระยะเวลาของไบต์ต่อหนึ่งหน้า
- 35 ชั่วโมงของวิดีโอที่ถูกอัพโหลดไปยัง YouTube ทุกๆนาทีในแต่ละวัน
(เหมือนกับ วงการฮอลลีวูดปล่อยภาพยนตร์เต็มเรื่อง 130,000 เรื่องในทุก ๆ
สัปดาห์แม้ว่าดูโดยที่ไม่มีป๊อปคอร์น)
- โปรแกรม JavaScript
ได้เติบโตขึ้นจากเส้นทางเล็กๆไปหลายร้อยกิโลไบต์ที่ต้องมีการประมวลผลในแต่
ละครั้งที่หน้าเว็บหรือโหลดแอปพลิเคชั่น
ดังนั้นข้อมูลที่หลั่งไหลเข้ามาจะทำให้หน้าเว็บบนเบราว์เซอร์โหลดช้าลง
จะทำให้อินเตอร์เน็ตมีข้อมูลเต็มจนไม่สามารถทำอะไรได้หรือไม่?
บางทีอาจ
จะไม่
รูปภาพและรูปถ่ายจะกลายเป็นเรื่องธรรมดาบนเว็บเมื่อนักวิศวะคอมค้นพบวิธีย่อ
ไฟล์ให้เป็นไฟล์ขนาดเล็กที่สามารถส่งและดาวโหลดได้ง่ายขึ้น ไฟล์ GIF และ
JPEG เป็นที่นิยมมากในบรรดาระบบ ในขณะที่ plug-ins
ถูกค้นพบเพื่อหลีกเลี่ยงข้อจำกัดในตอนต้นของ HTML
ดังนั้นวิดีโอสามารถอยู่และเล่นบนหน้าเว็บได้
ลองคิดการ
ไกลดูสิ แท๊กใน <video> HTML5 ทำให้ง่ายต่อการเล่นวิดีโอบนเว็บไซต์
Google ยังร่วมกับเว็บมวลชนบนWebM ความพยายามที่จะสร้างความอิสระ,
ข้อมูลข่าวสารที่เข้าถึงได้โดยผ่านการป้อนข้อมูลและคลื่นความถี่บนเว็บไซต์
ดังนั้นคุณภาพวิดีโอที่มีคุณภาพจะสามารถส่งไปยังคอมพิวเตอร์ในบ้านที่อยู่
นอกเมืองในรัฐ Nebraska หรือ สมาร์ทโฟนในเมือง Nairobi
ในขณะ
เดียวกันมันจริงที่หน้าเว็บที่มีจำนวนภาพขนาดใหญ่ หรือ รูปเยอะแยะมากมาย
ยังคงโหลดช้ามากๆ นั่นเป็นเหตุผลว่าทำไมนักวิศวกรที่ Google
ได้ทดลองด้วยวิธีใหม่ๆในการย่อรูปภาพในอนาคตข้างหน้า
ในขณะเดียวกันก็ยังคงเก็บคุณภาพและรายละเอียดเอาไว้ได้ครบและผลลัพธ์?
มันก็มีหวังมาก พวกเขาได้คิดค้นรูปภาพใหม่ที่เรียกว่า WebP
ที่ลดขนาดไฟล์ลงประมาณ 39%
Google
Chrome’s V8 ก็ใช้ระบบ JavaScript ที่มีความเร็วสูงตัวนี้ที่หรูเริด
นี่เป็นแค่ส่วนหนึ่งของเว็บเบราว์เซอร์ยุคใหม่
นั่นหมายความว่ายุคต่อไปของระบบ JavaScript
ที่มีประโยชน์และน่ามหัศจรรย์นี้จะไม่ไปกีดขวางการทำงานของรหัส JavaScript
ที่ซับซ้อน
เทคนิค
อีกอย่าง คือเบราว์เซอร์ที่ทันสมัยเหมือนนำ Chrome
มาใช้และโหลดหน้าเว็บให้เร็วเรียกว่า “DNS pre-resolution”
กระบวนการของการแปลงที่อยู่ของเว็บไปยังที่อยู่ IP ผ่าน DNS
หรือในทางกลับกันมักเรียกว่า “resolving” กับ “DNS pre-resolution” Chrome
จะกระตุ้นลิ้งอันอื่นบนหน้าเว็บทั้งหมด และ
แก้ไขลิ้งเหล่านั้นล่วงหน้าไปยังที่อยู่ IP ในพื้นหลัง
ดังนั้นเมื่อไหร่ที่คุณคลิ๊กลิ้งไดลิ้งหนึ่งบนหน้าเบราว์เซอร์จะพร้อมนำคุณ
ไปยังหน้าเว็บใหม่โดยทันที เมื่อเวลาผ่านไป Chrome
เรียนรู้จากการเยี่ยมชมที่ผ่านมาดังนั้นครั้งต่อไปที่คุณไปยังหน้าเว็บที่
คุณเคยเยี่ยมชมก่อนหน้านี้ Chrome จะรู้และแก้ไขลิ้งโดยอัติโนมัติ
และองค์ประกอบบนหน้าเว็บสัมพันธ์กันทั้งหมด
สักวัน
เบราว์เซอร์อาจจะสามารถคาดการก่อนที่จะโหลดหน้าเว็บ
ไม่เพียงแค่แก้ไขลิ้งล่วงหน้าแต่ยังมีองค์ประกอบของเว็บไซต์
(เช่นภาพหรือวิดีโอ) ไปถึง pre-fetch ก่อนเวลา
ที่จะทำให้เว็บมีความเร็วขึ้น
ในไม่ช้าพวกเราหวังว่าการโหลดเว็บใหม่บนเบราว์เซอร์จะเร็วพอๆกับการพลิกหน้าหนังสือ
ข้อมูลเพิ่มเติม
JavaScript
เป็นโปรแกรมประเภทตัวแปรภาษาหรือภาษาแบบ script จาก Netscape
มีลักษณะคล้ายกับภาษา Visual Basic Microsoft, Tool command language ของ
Sun, Practical Extraction and Reporting Language บน UNIX และ
Restructured Extended Executer ของ IBM โดยทั่วไปแล้วภาษา script
ง่ายกว่าภาษาแบบคอมไพล์ เช่น C และ C++ นอกจากนี้ภาษา script
จะมีขั้นตอนที่ยาวกว่าภายนอกแบบคอมไพล์ แต่ใช้ประโยชน์ได้มากในโปรแกรมสั้น ๆ
Javascript ถูกออกแบบมาให้ใช้งานร่วมกันกับ HTML
Javascript คือภาษาสคริปต์(การทำตามสคริปต์ที่เขียน)
Javascript มักจะฝังตัวในหน้า HTML
Javascript สามารถใช้ได้ทุกคน ไม่มีLicense แต่อย่างใด Javascript ทำไรได้บ้าง?
Javascript คือภาษาสคริปต์(การทำตามสคริปต์ที่เขียน)
Javascript มักจะฝังตัวในหน้า HTML
Javascript สามารถใช้ได้ทุกคน ไม่มีLicense แต่อย่างใด Javascript ทำไรได้บ้าง?
1. Javascript ถือเป็นเครื่องมือของผู้ออกแบบเว็บไซต์
2. Javascript มีการโต้ตอบต่อสถานการณ์ต่างๆในฝั่งClient เป็นอย่างดี
3. Javascript เก็บข้อมูลผู้เยี่ยมชมเว็บได้ หรือแม้กระทั่ง Browser ที่ใช้
Browser คือเครื่องมือที่ช่วยให้คุณสามารถท่องเที่ยวไปในโลกอินเตอร์เน็ตได้อย่างไร้ขีดกั้นทางด้านพรมแดนนอก
จากนี้ Browser ยังช่วยอำนวยความสะดวกในการเยี่ยมชมเว็บไซต์ต่างๆ
ซึ่งในขณะนี้บริษัทผลิตซอฟแวร์ค่ายต่างๆ นับวันจะทวีการแข่งขันกันในการผลิต
Browser เพื่อสร้างความพึงพอใจให้แก่นักท่องเว็บให้มากที่สุด หน้าตาของ
browser แตกต่างกันไปตามแต่การออกแบบการใช้งานของแต่ละค่ายโปรแกรม โปรแกรม Browser ที่เป็นที่นิยมในปัจจุบัน ได้แก่
-Internet Explorer
เป็น
Browser ที่มีสัญลักษณ์ไอคอนเป็นตัว e สีน้ำเงิน Browser
ตัวนี้ผลิตโดยบริษัท Microsoft ผู้ผลิตโอเอส DOS, Windows ฯลฯ ดังนั้น
Browser จะมีติดไปกับWindows จึงทำ Browser
ตัวนี้เป็นที่นิยมมากกว่าตัวอื่นๆ
-Mozilla FireFoxMozilla
FireFox หรือที่รู้จักกันในชื่อ FireFox
พัฒนาโดยมูลนิธิมอซิลลาและอาสาสมัครอีกหลายร้อยคน
ปัจจุบันอยู่ใต้การดำเนินงานของบริษัทมอซิลลา
ปัจจุบันไฟร์ฟอกซ์เป็นเว็บเบราว์เซอร์ที่นิยมอันดับ 2
รองจากอินเทอร์เน็ตเอกซ์พลอเรอร์ -Google Chrome เป็น Browser แบบโอเพนซอร์ซ ที่พัฒนาโดยกูเกิล โครมมีให้ดาวน์โหลดเพื่อทดสอบใช้งานสำหรับวินโดวส์ และมีภาษาที่ให้ใช้ได้มากกว่า 50 ภาษารวมถึงภาษาไทย รุ่นสำหรับแมคโอเอส และ ลินุกซ์ นั้นกำลังอยู่ระหว่างการพัฒนา ซึ่งจะเปิดให้ทดสอบในอนาคต |
ประโยชน์
ทำให้เราได้รู้จัก
วิธีต่างๆที่ช่วยให้เราอัพโหลดรูปภาพ, วิดีโอ ให้เร็วขึ้น
และย่อรูปภาพให้เล็กลงโดยที่คุณภาพของรูปนั้นยังคงคุณภาพเดิมอยู่
ไม่มีความคิดเห็น:
แสดงความคิดเห็น