css

YSlow, why slow?

25 Aug 2007

After Yahoo! Developer Center released their analysing tool, YSlow!, last week. I just have a chace to try it with my blog today. Here is the result.

Let’s see what can I do to make my blog faster.

  1. Make fewer HTTP requests - My blog has 9 external javascript references. Half of them are Google Analytics, BeYello and Google Reader relates. I can’t do anything much for them. The rest are ASP.NET Ajax related scripts. I can use the AjaxControlToolkit and take advantages of ToolkitScriptManager to combine all scripts into one request. Luckily, Subtext Dev team has integrated YUI Compressor into the build script and has already implemented script combiner for next version of Subtext which will be released soon. As for CSS, I have to reimplement my custom skin to take the advantages of new Subtext’s CSS Handler.
  2. Use a CDN - I can’t afford for this thing. Pass.
  3. Add an Expires header - There’re 16 links that don’t have expires header. Since adding the expires header means I must have the permission to access IIS Manager which I don’t. I have nothing to do here. Pass.
  4. Gzip components - Normally, Subtext has an integrated GZip Module. But all of unGzippped components are images and javascripts which don’t pass through ASP.NET Pipeline. Same as HTTP Requests number, I should wait for next release of Subtext that can help me resolve this issue. Pass.
  5. Reduce DNS lookups - Front page of my blog has more than 4 domains. Again, they’re Google Analytics, BeYello, and Google Reader scripts.Nothing to do here either. Pass
  6. Minify JS - JavaScript plays an important part nowsaday. In production environment, every JavaScript libraries should be compressed. Subtext has an uncompressed common script but it has been resolved in the next release. The another is BeYello script, again.
  7. Configure ETags - Same as expires header and GZip components. Pass.

After analysed each part, I can make my score a little higher. While I waiting for next release of Subtext, I can compress my JS and combine my css.

Last but not least, remember that YSlow! suggestions are just suggestion. Sometimes their suggestions are good, but for some conditions. You can ignore them if they’re not suit but you have to know what you are doing. Check the other people advice on YSlow! before take any action.

PS. Beyello, if you can hear me, please compress your javascript to let your clients load your scripts faster and save your precious bandwidth. You service is great and don’t let this little thing spoils it. ;)

โอ้ว ใครไม่รู้นามว่า GoBlox มาปล่อยคอมเม้นท์เอาไว้ ที่นี่ แบบไม่มีปี่ไม่มีขลุ่ย ไอ้เราก้องง ใช้ Subtext มานาน สปงสแปมเป็นยังไงไม่เจอมานาน มาเจออันนี้แวบแรกตกใจนึกว่ามันทะลุ Subtext มาได้ใจหายวาบ พอเห็นชื่อเว็บก็มั่นใจละว่าไม่ใช่สแปมชัวร์

เข้าไปทีแรก ก็อารายหว่า นึกว่าเว็บเปิดใหม่ ที่ไหนได้ เค้ามีมาตั้งนานแล้ว เหมือนว่าเคยเข้าด้วยแต่ตอนนั้นมันยังไม่มีอะไร อ่านๆไปก็โอเค นับว่าเป็นอีกที่ที่อยากแนะนำให้ web designer เข้าไปอ่านจริงๆเพราะที่นี่เค้าสอนทำ css-based layout แบบเริ่มตั้งแต่พื้นฐาน ผมอยากให้เค้าเขียนหนังสือมาขายจริงๆเลย คนไทยจะได้เริ่มหัดทำเว็บได้แบบที่มันควรจะเป็นกันซักทีไม่ใช่เอะอะเอะอะก็ตารางยันเลย ส่วนสำนวนก็เป็นเอกลักษณ์ รู้สึกอ่านตอนแรกแล้วแหม่งๆ แต่ผ่านไปซักพักก็ชักชิน อ่านแล้วจะนึกถึงบทความพี่หาวแห่ง 2how.com (ที่ผมเคยเข้าไปอ่านเล่นเมื่อนานมาแล้ว) สำนวนประมาณนั้นเลย อ่านได้เรื่อยๆไม่ค่อยน่าเบื่อ เสียอยู่อย่างคือแต่ละตอนสั้นไปหน่อย ถ้ารวมให้ยาวกว่านี้เป็นซักสองเท่าจะอ่านสบายขึ้นมาก

อยากจะเขียน CSS ให้เก่ง อันดับแรกแนะนำให้ เขียน XHTML ให้เป็นก่อนครับ ไม่ใช่เขียนให้ได้ แต่ เขียนให้เป็น ทำไมเขาจึงใช้ h ใช้ p ใช้ div ใช้ ul li ใช้ dl dt dd ใช้ strong ใช้ span ใช้ em ใช้ a ใช้ img ใช้แม่งมันทุกอย่างให้ถูกกาลเทศะ และ XHTML Tags เหล่านั้น มันมีกฎเกณฑ์และทำหน้าที่อย่างไรบ้างต้องทำความเข้าใจมันก่อน

CSS, XHTML Advanced Layout : เขียนเว็บ Tableless Design ตอนที่ 1 (Introduction to CSS XHTML Design)

เห็นย่อหน้านี้แล้วนึกถึงเวลาฝึกวรยุทธ์ไปซักพักแล้วต้องทำลายวรยุทธ์ที่ตัวเองเคยฝึกมา เพื่อฝึกพื้นฐานใหม่ก่อนฝึกยอดวิชา นั่นแหละอารมณ์นั้นเลย

แนะนำครับๆแนะนำ thaicss.com

Update 16/6/50: รู้สึกผิดนิดหน่อยที่ว่าว่าคนอื่นเขียนยาว เพราะปกติผมก็เขียนบล็อกสั้นๆ คือจริงๆแล้วผมหมายถึงในส่วนของบทความในแต่ละตอนมันสั้นไปนิดนึง แค่นั้นเอง แต่ถ้าเป็นแบบตอนเดียวจบมันยาวขนาดไหนก็น่าจะโอเคนะ

Technorati tags: ,
Tags: | 2 Comments