Static content can be compressed and then cached, only updating when the original files are changed, so it takes very little CPU usage to implement and it's pretty much a no-brainer to enable. Dynamic content (PHP, ASP.NET, etc.) can also be compressed, but since it is compressed separately for every request, it can take up significant amounts of CPU utilization.
Below is a quick guide to enable HTTP compression in IIS:
- Open up IIS manager and open up the properties for all web sites.
- Under the service tab, select the "Compress static files" and enter the value of the Temporary directory where the cached files will be kept. In addition, you should limit the temporary directory size to 1 GB or so.
- This will enable compression for .txt, .htm and .html files. However, .js and .css files can often be just as large as the HTML files.
- To enable compression for other extensions, you'll need to edit the Metabase. I recommend using Metabase Explorer for this. You'll need to edit the W3SVC\Filters\Compression\gzip\HcFileExtensions key and change it from "htm,html,txt" to "htm,html,txt,js,css"
- Now restart IIS to make the changes effective.
No comments:
Post a Comment