我使用ClickOnce发布Windows Forms应用程序。考虑到这个应用程序的整体大小,安装是相当大的。它是超过15MB的东西。如果我压缩本地构建的应用程序,它会被压缩到2.5MB。
ClickOnce部署可以以某种方式压缩吗?
如果没有,是否有人使用IIS压缩来加快传输速度?这会有帮助吗?
发布于 2009-02-05 14:45:22
据我所知,你不能手动压缩你的程序集。但是,您绝对可以使用IIS压缩。从我对带宽监视器的测试来看,它有很大的不同。一旦它设置好了,你就再也不用去想它了,它就会自动发生。
令我惊讶的是,这并没有被更多地提及。几年前,当我想要这样做的时候,我几乎找不到关于它的信息。但是,如果您运行的是IIS6.0,this article应该详细说明您需要进行的所有更改。我不确定这些指令对于更高版本的IIS会有多大的不同。
发布于 2011-02-23 14:59:53
ClickOnce没有任何内置的压缩支持。但您可以在web服务器级别使用HTTP压缩。
按照以下步骤在IIS7下启用压缩
%windir%\system32\inetsrv\config\applicationHost.config (参见我的评论,其他行是默认值)
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/atom+xml" enabled="true" />
<add mimeType="application/xaml+xml" enabled="true" />
<!--HERE! deploy files-->
<add mimeType="application/octet-stream" enabled="true" />
<!--HERE! application files-->
<add mimeType="application/x-ms-application" enabled="true" />
<!--HERE! manifest files-->
<add mimeType="application/x-ms-manifest" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>还是不能工作??将此文件添加到同一文件(默认情况下,IIS 7.0不会压缩文件,除非它们是“频繁请求”)
<serverRuntime frequentHitTimePeriod="00:00:59" />发布于 2009-06-30 07:32:39
这些说明对于更高版本的IIS是相同的。这个压缩非常快(它是在后台完成的,并且只有一次,直到文件被改变)
https://stackoverflow.com/questions/515254
复制相似问题