jb's Blog
"behold the turtle, he only makes progress when he sticks his neck out"
YSlow using IIS?
07 Aug 2007 14:56
Indeed!
Recently Yahoo put out a developer tool to snap into
Firebug
called
YSlow
. It analyzes a given web page and generates a marked score for a number of "performance traits" of the site. If a page can be improved, YSlow gives some tips on what can be improved.
The other day Simone put up
a horrid post
listing my blog as having a
D
ranking?!? What the...
So I had a nosey to see what he was on about and low and behold, there were definitely some areas for improvement.
Ok - so thats better! Maybe I should migrate to Akamai?
If you are using IIS 6 like me, you are likely to be failing on a couple of the rules:
3. Add an Expires header (for resources such as CSS/JPG)
This one is fairly easy. Browse to the directory holding your resources, select the properties, select the HTTP Headers tab and then enable Content Expiry. Set a number of days sometime in the future (e.g. 30).
4. Gzip components (for resources such as JS/CSS)
Firstly enable GZIP by right clicking on the Web Sites folder and selecting the Service tab. Check the appropriate boxes. I normally just enable static file compression.
Next edit the Metabase.xml in %windir%\system32\inetsrv (you will need to enable Direct Metabase editing for this on the properties for the top level node in IIS Manager)
Find the section named HcFileExtensions (there will be 2 of them) and modify them to include any static resources you want compressed.
Mine looks like this:
HcFileExtensions="htm
html
txt
js
css"
You will need to do an IIS reset to finish off and you might want to disable Direct Metabase Editing as well :)
13. Configure ETags
This one on the face of it is quite annoying, that is until I found
this article
! Compile the code using Visual C++, or just
download a binary version
.
You can install it into IIS by adding a new ISAPI filter (either at the Web Sites level or to a specific site), it will show as unknown initially, which is fine. Make sure you allow the filter to run by adding it as the
same name
into the Web Service Extensions and set the extention to be allowed.
You will need to do an IIS reset to finish off.
And done! Your site now should be much better off to deal with that impending Slashdotting :)
Adam
-
@ 07 Aug 2007 04:39
From my understanding of it, the ETags are only an issue if you're serving from multiple servers. The idea being that ETags are used to determine if the browser should redownload a previously cached file... so the server returns a unique tag for the requested file depending on a number of variables, including server specific info (such as the time, for example). The problemsc come when you're serving from multiple servers (load balancing) - so you may request a file that hasn't changed, but the request goes to the other server. Now the chances of the other server producing the exact same Etag seems to be quite low (say, the time isn't exactly accurate) - so the browser decides to redownload the file (even though it's not required).
jb
-
@ 07 Aug 2007 07:42
Yep, thats correct - although given the flakey support for them in IIS 6 you may want to remove them as they can just regenerate based off configuration change which negates the caching usefulness. Assuming the cache is correctly honoring the Expires header all should still be well :)
Dotnetshadow
-
@ 12 Aug 2007 03:32
Thanks for clearing up the ETags section I too came across that article, but I was wondering if IIS6 has any option to even configure an Etag? I couldn't find anything that would change or edit how ETags get generated etc Also if ETag was to be used what's the real problem with them in terms of YSlow point of view what can be done?
Simone
-
@ 21 Aug 2007 09:00
jb, now you are back to 70... what happened?
sirrocco
-
@ 14 Sep 2007 02:04
And yet you get an F on Gzip components ? Did you remove the compression ?
tin
-
@ 14 Oct 2007 03:30
hi yanno, thank you very much for putting this code together! i am trying to get a better score score of YSlow! for my site, and currently i am struggling with this etag thing. and i found this page from google. i don't know c/c++, so i just downloaded the zip you have provided and attempted to install it on my iis. however, after i setup the isapi filter, the web service extension, and restarted IIS, the site refused to start, i see "service unavailable" message when i access the site. on the server, i see the below 2 errors from the event viewer, any ideas? i am using win2k3 standard with sp1 and iis 6. The HTTP Filter DLL C:\Inetpub\RemEtag\RemEtag.dll failed to load. The data is the error. Could not load all ISAPI filters for site/service. Therefore startup aborted. please advice. thanks!
Purvesh
-
@ 19 Dec 2007 03:46
Hi Guys even no need to implement module to remove Etag just go to Inetmgr and add header in your web site Key = "Etag" Value = "" it will remove Etag from your .js,.Css and .image file
Quequeephelry
-
@ 09 Jul 2008 05:23
tests time mashine
Add a new comment:
Name:
Website:
Comment:
history
2006 (47)
2007 (79)
January 2008 (5)
February 2008 (17)
March 2008 (7)
April 2008 (4)
May 2008 (1)
June 2008 (6)
August 2008 (1)
blogs i read
JDs Weblog
Andrews Blog
Chris Auld
Josh Robb
Ivan Porto Carrero
Rod Drury
Nic Wise
Alex James
Darryl Burling (MS)
Nigel Parker (MS)
Sean McBreen (MS)
links
Mindscape
Intergen
rss feed