ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ThaiSEOBoard.comพัฒนาเว็บไซต์Programmingcookieless domain คืออะไรครับ.
หน้า: [1]   ลงล่าง
พิมพ์
ผู้เขียน หัวข้อ: cookieless domain คืออะไรครับ.  (อ่าน 2001 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
smapan
Global Moderator
เจ้าพ่อบอร์ดเสียว
*****

พลังน้ำใจ: 643
ออฟไลน์ ออฟไลน์

กระทู้: 8,272



ดูรายละเอียด เว็บไซต์
« เมื่อ: 11 มกราคม 2010, 10:22:25 »

พอดีว่าไปเจอมาในเนท แต่อ่านไงก็ไม่เข้าใจเค้าว่าจะทำให้เว็บเร็วขึ้นอ่ะครับ
Serve static content from a cookieless domain
Overview

Serving static resources from a cookieless domain reduces the total size of requests made for a page.
Details

Static content, such as images, JS and CSS files, don't need to be accompanied by cookies, as there is no user interaction with these resources. You can decrease request latency by serving static resources from a domain that doesn't serve cookies. This technique is especially useful for pages referencing large volumes of rarely cached static content, such as frequently changing image thumbnails, or infrequently accessed image archives. We recommend this technique for any page that serves more than 5 static resources. (For pages that serve fewer resources than this, it's not worth the cost of setting up an extra domain.)

To reserve a cookieless domain for serving static content, register a new domain name and configure your DNS database with a CNAME record that points the new domain to your existing domain A record. Configure your web server to serve static resources from the new domain, and do not allow any cookies to be set anywhere on this domain. In your web pages, reference the domain name in the URLs for the static resources.

If you host your static files using a CDN, your CDN may support serving these resources from another domain. Contact your CDN to find out.
Recommendations

Enable proxy caching.
    For resources that rarely change, set caching headers for browsers and proxies. Because cookies will not be sent for these resources, there is no risk that proxy caches will cache user-specific content.
Don't serve early loaded external JS files from the cookieless domain.
    For JavaScript referenced in the head of the document and needed for page startup, it should be served from the same hostname as the main document. Because most browsers block other downloads and rendering until all JavaScript files have been downloaded, parsed and executed, it's better to avoid the risk of an additional DNS lookup at this point of processing.

Example

Many Google properties, including News and Code (this site), serve static resources, such as JS files and images, from a separate domain, www.gstatic.com . No cookies can be set on this domain. For the News homepage at news.google.com, you can see the cookie in the request header in this screen shot:

But for www.static.com , which is used to serve the News logo .gif file, no cookie headers appear in the request or response:

บันทึกการเข้า

จูมล่าโฮส สยามโฮสเว็บ modty.com
รวมที่พัก เช่ารายวัน ที่พักเช่ารายเดือนมากที่สุดแจ่มจริง
***Tel 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ ถ้าตอบได้ช่วยแน่นอน ไม่มีกั้ก. ***
mean
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 121
ออฟไลน์ ออฟไลน์

กระทู้: 1,009



ดูรายละเอียด เว็บไซต์
« ตอบ #1 เมื่อ: 15 มกราคม 2010, 17:50:56 »

เอ่ เป็นการช่วยแครช ส่งต่อไปใช้หน้า page อื่นๆ หรือป่าวครับ
ส่งผลให้ไม่ต้องโหลด obj บางอย่างใหม ไม่แน่ใจนะครับ
บันทึกการเข้า

smapan
Global Moderator
เจ้าพ่อบอร์ดเสียว
*****

พลังน้ำใจ: 643
ออฟไลน์ ออฟไลน์

กระทู้: 8,272



ดูรายละเอียด เว็บไซต์
« ตอบ #2 เมื่อ: 15 มกราคม 2010, 23:02:31 »

 Cry กระทู้ผมเปนหมันซะละ

ขอบคุณนะครับ ที่มาแนะนำครับ  wanwan011
บันทึกการเข้า

จูมล่าโฮส สยามโฮสเว็บ modty.com
รวมที่พัก เช่ารายวัน ที่พักเช่ารายเดือนมากที่สุดแจ่มจริง
***Tel 083-757-1515 ติดปัญหา Joomla ตรงไหนรับปรึกษาฟรี โทรมาเถอะครับ ถ้าตอบได้ช่วยแน่นอน ไม่มีกั้ก. ***
Reality
สมุนแก๊งเสียว
*

พลังน้ำใจ: 51
ออฟไลน์ ออฟไลน์

กระทู้: 757



ดูรายละเอียด เว็บไซต์
« ตอบ #3 เมื่อ: 15 มกราคม 2010, 23:07:16 »

เหมือนเป็นการเก็บ cache ที่ฝั่ง client น่ะครับ

ปกติเว็บไซต์ในไทย ส่วนมากไม่ใช้ระบบ cookie นอกจากระบบ login (ตรงที่มันติ๊กว่า ให้จำรหัสผ่าน อ่ะครับ)


เขาก็เลยหาวิธีเอา cookie ตรงนั้นมาใช้เป็น cache ไป (ก็ปกติไม่ได้ใช้อยู่แล้ว ก็ทำตัวให้เป็นประโยชน์ซะดีๆ)


คือผมก็ยังงงๆ อ่ะนะ ขออ่านต่ออีกแป๊บนึง

---

ไม่ใช่เลยครับ

ผมตะหงิดๆ ตั้งแต่คำว่า Cookies less แล้วครับ

Cookies less domain ก็คือ เวลาเรา Request Static object ต่างๆ เช่น รูป, เสียง, วิดีโอ ต่างๆ นาๆ
ปกติเวลาผู้ใช้มี cookie ของเว็บเราอยู่ เวลาเรียกเขาก็จะส่ง cookie มาที่เว็บเราด้วยครับ
ทำให้เสียเวลา ในการ request ตรงนั้นไป (คือมันอาจจะเสียเวลาน้อย.. แต่ถ้ารีเควสเยอะล่ะ ก็น่าคิดนะครับ)

ทางแก้ก็คือ เขาแยกโดเมนออกจากกันครับ หมายถึงการสร้าง sub domain หรือ เขียนโปรแกรม
กำหนด path ให้คุ๊กกี้ ไม่ยุ่งเกี่ยวกับพาธ Static Object ครับ

กระจ่างละ ความรู้ใหม่จริงๆ ครับ
« แก้ไขครั้งสุดท้าย: 15 มกราคม 2010, 23:14:57 โดย Luscentz » บันทึกการเข้า

*You walk right into reality, While my heart's still wild and free.. 

Midnight Adventure
mean
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 121
ออฟไลน์ ออฟไลน์

กระทู้: 1,009



ดูรายละเอียด เว็บไซต์
« ตอบ #4 เมื่อ: 15 มกราคม 2010, 23:42:21 »

 อ่อมันเป็นเยี่ยงนี้เอง ขอบคุณที่ช่วยชี้ทางนะครับ
แหม่ สาย optiz นี่เล็กๆ น้อยๆ ก็เก็บหมด
บันทึกการเข้า

หน้า: [1]   ขึ้นบน
พิมพ์