Your two options do completely different things. First, [if IE 7] allows the browser to decide what to do. The second makes the server crucial.
The first will work with layer caching, which assumes that all browsers should see the same markup. The second will not.
Also, consider Modernizr rather than building your own support for IE 7.
source share