Note the ETag HTTP response header when using the DotLess library in your ASP.NET MVC application

Posted: (EET/GMT+2)

 

If you are using the DotLess library in your ASP.NET (MVC) applications, you might have noticed that the library utilizes the ETag HTTP response header field to mark the current state of the CSS stylesheet content.

The ETag header is part of the HTTP/1.1 specification (see section 14.19), and can be used for various things. In the case of the DotLess library, the value indicates the version of the content: if the LESS data changes, so does the ETag header value.

Here's an example:

ETag: "cEgibKV5e74P2HWQAh7ggOzBhHF0eqEoCwD4tvEluEo="

Note that the value is not a hash of the content, it merely changes every time to LESS source code file changes.