Carlos Mendes - 55 - Sep 20, 2014

When using the Request.ToOptimizedResultUsingCache in a service that renders a razor view I get 3 keys in Redis:

cachekeyname
cachekeyname.html

Apparently the first two keys are relative to the JSON and HTML results being cached. Is there a way just to cache the html?

cachekeyname.html.deflate

Could someone explain what this third cache key is about?

Thanks

its contains the compressed (deflated) version of the serialized content-type response. Most browsers accept deflate so it will usually return the optimized deflated version of the response when it exists.

Carlos Mendes:

Thank you Demis. Is there a way to cache just the html?

Nope. Don’t see why that’d be preferred, the compressed version is even smaller and faster than the original content and gzip/deflate is built into HTTP making it a transparent detail that most HTTP tools auto-decode by default.