Skip to content

Commit

Permalink
Updated a sample projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Taritsyn committed Jul 17, 2018
1 parent a041684 commit cef8a3b
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 64 deletions.
28 changes: 3 additions & 25 deletions samples/WebMarkupMin.Sample.AspNet4.Mvc4/Web.Release.config
@@ -1,31 +1,9 @@
<?xml version="1.0"?>

<!-- For more information on using Web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an atrribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your Web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
<caching>
<outputCache xdt:Transform="RemoveAttributes(enableOutputCache)" />
</caching>
</system.web>
</configuration>
3 changes: 2 additions & 1 deletion samples/WebMarkupMin.Sample.AspNet4.Mvc4/Web.config
Expand Up @@ -15,7 +15,8 @@
<outputCacheSettings>
<outputCacheProfiles>
<add name="CacheCompressedContent5Minutes" duration="300"
varyByContentEncoding="gzip;deflate" location="ServerAndClient" />
varyByContentEncoding="gzip;deflate" varyByParam="none"
location="ServerAndClient" />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
Expand Down
@@ -1,6 +1,6 @@
<%@ Page Title="Change log" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
CodeBehind="ChangeLog.aspx.cs" Inherits="WebMarkupMin.Sample.AspNet45.WebForms.ChangeLog" %>
<%@ OutputCache CacheProfile="CacheCompressedContent5Minutes" VaryByParam="*" %>
<%@ OutputCache CacheProfile="CacheCompressedContent5Minutes" %>
<asp:Content ContentPlaceHolderID="mainContent" runat="server">
<div class="l-main-content">
<h2><%: Page.Title %></h2>
Expand Down
2 changes: 1 addition & 1 deletion samples/WebMarkupMin.Sample.AspNet45.WebForms/Contact.aspx
@@ -1,6 +1,6 @@
<%@ Page Title="Contact" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
CodeBehind="Contact.aspx.cs" Inherits="WebMarkupMin.Sample.AspNet45.WebForms.Contact" %>
<%@ OutputCache CacheProfile="CacheCompressedContent5Minutes" VaryByParam="*" %>
<%@ OutputCache CacheProfile="CacheCompressedContent5Minutes" %>
<asp:Content ContentPlaceHolderID="mainContent" runat="server">
<div class="l-main-content">
<h2><%: Page.Title %></h2>
Expand Down
2 changes: 1 addition & 1 deletion samples/WebMarkupMin.Sample.AspNet45.WebForms/Default.aspx
@@ -1,6 +1,6 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="WebMarkupMin.Sample.AspNet45.WebForms.Default" %>
<%@ OutputCache CacheProfile="CacheCompressedContent5Minutes" VaryByParam="*" %>
<%@ OutputCache CacheProfile="CacheCompressedContent5Minutes" %>
<asp:Content ContentPlaceHolderID="mainContent" runat="server">
<div class="l-main-content">
<h2>Project Description</h2>
Expand Down
28 changes: 3 additions & 25 deletions samples/WebMarkupMin.Sample.AspNet45.WebForms/Web.Release.config
@@ -1,31 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>

<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an attribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<compilation xdt:Transform="RemoveAttributes(debug)" />
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
<caching>
<outputCache xdt:Transform="RemoveAttributes(enableOutputCache)" />
</caching>
</system.web>
</configuration>
3 changes: 2 additions & 1 deletion samples/WebMarkupMin.Sample.AspNet45.WebForms/Web.config
Expand Up @@ -27,7 +27,8 @@
<outputCacheSettings>
<outputCacheProfiles>
<add name="CacheCompressedContent5Minutes" duration="300"
varyByContentEncoding="gzip;deflate" location="ServerAndClient" />
varyByContentEncoding="gzip;deflate" varyByParam="none"
location="ServerAndClient" />
</outputCacheProfiles>
</outputCacheSettings>
</caching>
Expand Down
Expand Up @@ -22,7 +22,7 @@
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.TagHelpers" Version="1.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.6" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.0.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.2" />
Expand Down
6 changes: 6 additions & 0 deletions samples/WebMarkupMin.Sample.AspNetCore1Full.Mvc1/Startup.cs
Expand Up @@ -4,6 +4,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
Expand Down Expand Up @@ -116,6 +117,11 @@ public void ConfigureServices(IServiceCollection services)
;

// Add framework services.
var manager = new ApplicationPartManager();
manager.ApplicationParts.Add(new AssemblyPart(typeof(Startup).Assembly));

services.AddSingleton(manager);

services.AddMvc(options =>
{
options.CacheProfiles.Add("CacheCompressedContent5Minutes",
Expand Down
Expand Up @@ -21,7 +21,7 @@
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="1.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.TagHelpers" Version="1.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.0.6" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.0.6" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.0.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.0.2" />
Expand Down
7 changes: 6 additions & 1 deletion samples/WebMarkupMin.Sample.AspNetCore2.Mvc2/Startup.cs
Expand Up @@ -55,6 +55,9 @@ public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton(Configuration);

// Add response caching service.
services.AddResponseCaching();

// Add WebMarkupMin services to the services container.
services.AddWebMarkupMin(options =>
{
Expand Down Expand Up @@ -122,7 +125,7 @@ public void ConfigureServices(IServiceCollection services)
{
NoStore = HostingEnvironment.IsDevelopment(),
Duration = 300,
Location = ResponseCacheLocation.Client,
Location = ResponseCacheLocation.Any,
VaryByHeader = "Accept-Encoding"
}
);
Expand Down Expand Up @@ -156,6 +159,8 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF

app.UseStaticFiles();

app.UseResponseCaching();

app.UseWebMarkupMin();

app.UseMvc(routes =>
Expand Down
Expand Up @@ -18,12 +18,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.0.2" />

<ProjectReference Include="..\..\src\WebMarkupMin.AspNetCore2\WebMarkupMin.AspNetCore2.csproj" />
<ProjectReference Include="..\WebMarkupMin.Sample.Logic\WebMarkupMin.Sample.Logic.csproj" />
Expand Down

0 comments on commit cef8a3b

Please sign in to comment.