diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/WebVirtualDirectory.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/WebVirtualDirectory.cs
index 3be281fd..e89c2250 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/WebVirtualDirectory.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/WebVirtualDirectory.cs
@@ -56,6 +56,8 @@ namespace WebsitePanel.Providers.Web
private bool enableAnonymousAccess;
private bool enableWindowsAuthentication;
private bool enableBasicAuthentication;
+ private bool enableDynamicCompression;
+ private bool enableStaticCompression;
private string defaultDocs;
private string httpRedirect;
private HttpError[] httpErrors;
@@ -167,6 +169,17 @@ namespace WebsitePanel.Providers.Web
set { this.enableBasicAuthentication = value; }
}
+ public bool EnableDynamicCompression
+ {
+ get { return this.enableDynamicCompression; }
+ set { this.enableDynamicCompression = value; }
+ }
+ public bool EnableStaticCompression
+ {
+ get { return this.enableStaticCompression; }
+ set { this.enableStaticCompression = value; }
+ }
+
public bool AspInstalled
{
get { return this.aspInstalled; }
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/Compression/CompressionModuleService.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/Compression/CompressionModuleService.cs
new file mode 100644
index 00000000..8602675e
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/Compression/CompressionModuleService.cs
@@ -0,0 +1,53 @@
+using System;
+using Microsoft.Web.Administration;
+using Microsoft.Web.Management.Server;
+using WebsitePanel.Providers.Web.Iis.Common;
+
+namespace WebsitePanel.Providers.Web.Compression
+{
+
+ internal static class CompressionGlobals
+ {
+ public const int DynamicCompression = 1;
+ public const int StaticCompression = 2;
+ }
+
+
+ internal sealed class CompressionModuleService : ConfigurationModuleService
+ {
+ public const string DynamicCompression = "doDynamicCompression";
+ public const string StaticCompression = "doStaticCompression";
+
+ public PropertyBag GetSettings(ServerManager srvman, string siteId)
+ {
+ var config = srvman.GetApplicationHostConfiguration();
+ //
+ var section = config.GetSection(Constants.CompressionSection, siteId);
+ //
+ PropertyBag bag = new PropertyBag();
+ //
+ bag[CompressionGlobals.DynamicCompression] = Convert.ToBoolean(section.GetAttributeValue(DynamicCompression));
+ bag[CompressionGlobals.StaticCompression] = Convert.ToBoolean(section.GetAttributeValue(StaticCompression));
+ //
+ return bag;
+ }
+
+ public void SetSettings(string virtualPath, bool doDynamicCompression, bool doStaticCompression)
+ {
+ using (var srvman = GetServerManager())
+ {
+ var config = srvman.GetApplicationHostConfiguration();
+ //
+ var section = config.GetSection(Constants.CompressionSection, virtualPath);
+ //
+ section.SetAttributeValue(DynamicCompression, doDynamicCompression);
+ section.SetAttributeValue(StaticCompression, doStaticCompression);
+
+ //
+ srvman.CommitChanges();
+ }
+ }
+
+
+ }
+}
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs
index 4621a078..0b436282 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs
@@ -38,6 +38,7 @@ using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.OS;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.Utils;
+using WebsitePanel.Providers.Web.Compression;
using WebsitePanel.Providers.Web.Handlers;
using WebsitePanel.Providers.Web.HttpRedirect;
using WebsitePanel.Providers.Web.Iis.Authentication;
@@ -78,6 +79,7 @@ namespace WebsitePanel.Providers.Web
public const string AnonymousAuthenticationSection = "system.webServer/security/authentication/anonymousAuthentication";
public const string BasicAuthenticationSection = "system.webServer/security/authentication/basicAuthentication";
public const string WindowsAuthenticationSection = "system.webServer/security/authentication/windowsAuthentication";
+ public const string CompressionSection = "system.webServer/urlCompression";
public const string StaticContentSection = "system.webServer/staticContent";
public const string ModulesSection = "system.webServer/modules";
public const string IsapiCgiRestrictionSection = "system.webServer/security/isapiCgiRestriction";
@@ -347,6 +349,7 @@ namespace WebsitePanel.Providers.Web
private AnonymAuthModuleService anonymAuthSvc;
private WindowsAuthModuleService winAuthSvc;
private BasicAuthModuleService basicAuthSvc;
+ private CompressionModuleService comprSvc;
private DefaultDocsModuleService defaultDocSvc;
private CustomHttpErrorsModuleService customErrorsSvc;
private CustomHttpHeadersModuleService customHeadersSvc;
@@ -519,6 +522,7 @@ namespace WebsitePanel.Providers.Web
winAuthSvc = new WindowsAuthModuleService();
anonymAuthSvc = new AnonymAuthModuleService();
basicAuthSvc = new BasicAuthModuleService();
+ comprSvc = new CompressionModuleService();
defaultDocSvc = new DefaultDocsModuleService();
classicAspSvc = new ClassicAspModuleService();
httpRedirectSvc = new HttpRedirectModuleService();
@@ -623,6 +627,8 @@ namespace WebsitePanel.Providers.Web
virtualDir.AnonymousUserPassword = (string)bag[AuthenticationGlobals.AnonymousAuthenticationPassword];
virtualDir.EnableAnonymousAccess = (bool)bag[AuthenticationGlobals.Enabled];
+
+
// load windows auth
bag = winAuthSvc.GetAuthenticationSettings(srvman, virtualDir.FullQualifiedPath);
virtualDir.EnableWindowsAuthentication = (bool)bag[AuthenticationGlobals.Enabled];
@@ -636,10 +642,17 @@ namespace WebsitePanel.Providers.Web
bag = classicAspSvc.GetClassicAspSettings(srvman, virtualDir.FullQualifiedPath);
virtualDir.EnableParentPaths = (bool)bag[ClassicAspGlobals.EnableParentPaths];
//
+
+ //gzip
+ bag = comprSvc.GetSettings(srvman, virtualDir.FullQualifiedPath);
+ virtualDir.EnableDynamicCompression = (bool)bag[CompressionGlobals.DynamicCompression];
+ virtualDir.EnableStaticCompression = (bool)bag[CompressionGlobals.StaticCompression];
+
virtualDir.IIs7 = true;
}
- private void FillIISObjectFromVirtualDirectory(WebVirtualDirectory virtualDir)
+
+ private void FillIISObjectFromVirtualDirectory(WebVirtualDirectory virtualDir)
{
dirBrowseSvc.SetDirectoryBrowseEnabled(virtualDir.FullQualifiedPath, virtualDir.EnableDirectoryBrowsing);
//
@@ -648,6 +661,8 @@ namespace WebsitePanel.Providers.Web
winAuthSvc.SetEnabled(virtualDir.FullQualifiedPath, virtualDir.EnableWindowsAuthentication);
//
basicAuthSvc.SetAuthenticationSettings(virtualDir);
+ //
+ comprSvc.SetSettings(virtualDir.FullQualifiedPath, virtualDir.EnableDynamicCompression, virtualDir.EnableStaticCompression);
//
defaultDocSvc.SetDefaultDocumentSettings(virtualDir.FullQualifiedPath, virtualDir.DefaultDocs);
//
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebsitePanel.Providers.Web.IIs70.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebsitePanel.Providers.Web.IIs70.csproj
index eee780ba..7fda4ba2 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebsitePanel.Providers.Web.IIs70.csproj
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebsitePanel.Providers.Web.IIs70.csproj
@@ -91,6 +91,7 @@
+ |
+