I've set the OutputCache to include 'VaryByContentEncodings="gzip"' in my ASP.net ASPX page. I want the page to serve different css files, a gzipped if the browser support it and the regular non compressed if the browser doesn't support compression.
Example:
<%@ OutputCache Duration="320" VaryByParam="none" VaryByContentEncodings="gzip" %>
When I run the code I get the following error:
The 'varybycontentencodings' attribute is not supported by the 'outputcache' directive in a page.
I don't know what's the problem and why it doesn't work. Second, do you think that by serving different gzip/non-compressed CSS I'm doing the right thing. Just note that the files are served from Amazon S3, so I can't rely on IIS or .NET engine to return the compressed files automatically. That's why I want to serve to separate cached version of the page.
In this it seems to be ok, but it doesn't work (using ASP.NET 4.5):
http://msdn.microsoft.com/en-us/library/system.web.httpcachevarybycontentencodings.aspx
Help would be greatly appreciated.