The <httpCompression> element
specifies the HTTP compression settings for Internet Information Services (IIS)
7. HTTP compression can provide faster transmission times between IIS and
client browsers that can accept compressed files.
Note: An HTTP client must initiate
communication for compressed content by sending the appropriate HTTP
Accept-encoding header. If a client is not capable of HTTP compression, it will
not pass that header and IIS 7 will always return uncompressed content.
There are two different types of compression that IIS 7 uses:
·
Static Compression:
IIS 7 caches compressed static content in the path that is specified by
the directory attribute, which increases compression
performance by eliminating the need to recompress content that has already been
compressed. After IIS 7 has compressed a file, subsequent requests are given
the compressed copy of the file from the cache directory.
The staticCompressionEnableCpuUsage and staticCompressionDisableCpuUsage attributes
specify when IIS 7 will compress static files based on CPU usage.
You should use
static compression with files that do not typically change, such as HTML files
(*.html, *.htm), text files (*.txt), Microsoft Office documents (*.doc, *.xls,
*.ppt), etc. The size of these files can be reduced through compression, which
reduces download times for client requests and reduces bandwidth on the server.
Note: Image files such
as *.jpg and *.png files are also static files, but typically they do not
benefit from HTTP compression because these image files are already compressed.
·
Dynamic Compression:
Unlike static
compression, IIS 7 performs dynamic compression each time a client requests the
content, but the compressed version is not cached to disk. This change is made
because of the primary difference between static and dynamic content. Static
content does not change. However, dynamic content is typically content that is
created by an application and therefore changes often, such as Active Server
Pages (ASP) or ASP.NET content. Since dynamic content should change often, IIS
7 does not cache it.
The dynamicCompressionEnableCpuUsage and dynamicCompressionDisableCpuUsage attributes
specify when IIS 7 will compress dynamic files based on CPU usage.
WINDOWS SERVER 2012 OR WINDOWS SERVER 2012 R2
On the taskbar, click Server Manager.
In Server
Manager, click the Manage menu,
and then click Add Roles and
Features.
In the Add
Roles and Features wizard, click Next.
Select the installation type and click Next.
Select the destination server and click Next.
On the Server
Roles page, expand Web
Server (IIS), expand Web
Server, expand Performance,
and then select Static Content
Compression and/or Dynamic
Content Compression. Click Next.
On the Select
features page, click Next.
On the Confirm
installation selections page, click Install.
On the Results page,
click Close.

No comments :
Post a Comment