YSlow yields inconsistent ETags results

When I run YSlow against my site, I get "F" in the "Configure ETags" element; he claims that there are no epags for many (all?) of my images, style sheets, etc.

However, if I run a test on one of these images directly, I get A in the test tag. In addition, in the headers of the Firebug Net response panels, I see this element of this element for both full-page and direct URLs.

Is there anything I can do to cause this weird behavior?

(The URLs that I click are here and here if someone wants to check themselves. I would not mind checking common sense to see if they got confused in my browser.)

+4
source share
2 answers

tried this locally with FF 3.6 and YSlow 2.0.3 (recently released version) and standalone image. Gives a rating of "B", referring to incorrectly configured ETags.

The ETag is displayed in the header, bith in the Firebug net panel and in the YSlow component panel.

But, this is by design. If you look at http://developer.yahoo.com/performance/rules.html#etags , you will see that the default ETags generated by IIS and Apache are not optimal.

For reference, the actual lint rule in YSlow checks the following two regular expressions:

apache_re = new RegExp("^[0-9a-z]+-[0-9a-z]+-[0-9a-z]+$"); iis_re = new RegExp("^[0-9a-z]+:[0-9a-z]+$"); 
+2
source

My answer regarding IIS 7 is to ignore the YSlow recommendation.

IIS 7 uses the zero metabase change value when generating ETag. This is the part after the colon ... so etag will always be something like "5321116d3585ce1: 0", where the first part is created from the last modified file time, and then the colon number and metabase number.

Starting with IIS 7, Microsoft constantly sets this change number to zero, so it will be the same even on multiple web servers. For IIS 5 and 6, you can set it to zero if you want to achieve the same end result:

http://technet.microsoft.com/en-us/library/ee619764(WS.10).aspx

If YSlow still uses the regex rule iis_re = new RegExp ("^ [0-9a-z] +: [0-9a-z] + $"); incorrect and should be rewritten to accept etag as valid if it ends in : 0

+5
source

Source: https://habr.com/ru/post/1298966/


All Articles