I have a feeling this is possibly an IIS issue, and not CF, but if there's a way I can leverage CF, then I'll use that as the solution.
The problem is when I have a static CSS or JS file, say at /webroot/assets/styles.css, when I request it, it takes 200ms. Sure enough, An ETag header is generated and sent, and on subsequent requests, the response becomes like 15ms and I can see the appropriate If-Since and ETag request/response headers which indicates "I have this file, no need to resend it" and results in a 304 Not Modified. Perfect. Cache at its best.
But I am now rendering my CSS/JS dynamically through a call to a CFC, say at /webroot/services.cfc?getCSS. When I request it, it takes 500-1500ms, and no matter how many times I re-request it, it never generates an ETag, even though the content being returned has not changed.
Since the server seems to control the naming conventions on the ETag provided, and whether one is issued or not, I was wondering if anyone knew if this behavior was by design, or if there is a way I can just use the CFHeader and provide an ETag header that would be respected by the client/server connection? I am wondering if the presence of a query string in the URL is what is preventing IIS from issuing the ETag, even though the content is static.