1
votes

I am using HTTP compression provided by IIS for gziping static and dynamic content of my sites. I see the gzipped content returned to browser (Content-Encoding header in response is showing gzip) as well. All my application pools are using Network Service identity and I have given full control of compression folder (D:\Compression) to Network Service. I have set staticCompressionIgnoreHitFrequency to True as well at Configuration Editor => system.webServer => httpCompression location.

The issue is I see folders created under the compression folder but no files inside those.

1
Use FREB to find out why static compression is not working as expected, see my answerPeter Hahndorf
Thanks @PeterHahndorf. I referred failed request logs and found reason to be NO_MATCHING_CONTENT_TYPE. Not sure, why am I getting it. I already have text/* mime type enabled in both static and dynamic sections of my applicationHost.config file. Just to test, I enabled */* as well but still getting that error. I restarted the IIS after making these changes.Lalit Bhatt
Sorry @PeterHahndorf. Forgot to mention that I am accessing an aspx page so this shouldn't be any issue as it will have text/html as the mime type when returned to client.Lalit Bhatt

1 Answers

0
votes

I think what you see is the expected behaviour.

The compressed files in system.webServer\httpCompression\directory will only exist for compressed static files, compressed by the StaticCompressionModule and normally processed by the StaticFileModule.

Any requests handled by application frameworks such as asp.NET are not processed by the StaticCompressionModule by design. They may be processed by the DynamicCompressionModule, but that module doesn't write any files to disk.

You can test this by creating a large file test.html, hit it a few times, a compressed version will show up in temp\IIS Temporary Compressed Files, now make a copy of that file with a name of test.aspx, hit that one, it will not be compressed.

Static compression is only for static files that don't change much, it makes no sense to have a compressed version of a dynamic page on disk, because the expectation is that the content changes very frequently.