Skip to content

Commit b40ebbb

Browse files
authored
Merge pull request #638 from aspnetboilerplate/pr/6421
Scripts updated with GetScriptsResponsePerUserConfiguration
2 parents 1a0f170 + c2c99fa commit b40ebbb

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Account/_Scripts.cshtml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
@using System.Globalization
2+
@using Abp.AspNetCore.Mvc.Caching
3+
@using Abp.CachedUniqueKeys
24
@inject AbpCompanyName.AbpProjectName.Timing.AppTimes AppTimes
3-
5+
@inject ICachedUniqueKeyPerUser CachedUniqueKeyPerUser
6+
@inject IGetScriptsResponsePerUserConfiguration GetScriptsResponsePerUserConfiguration
47

58
<environment names="Development">
69
@*core scripts start*@
@@ -81,4 +84,12 @@
8184

8285
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
8386
<script src="~/AbpServiceProxies/GetAll?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
84-
<script src="~/AbpScripts/GetScripts?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
87+
88+
@if (GetScriptsResponsePerUserConfiguration.IsEnabled)
89+
{
90+
<script src="@(ApplicationPath)AbpScripts/GetScripts?v=@(await CachedUniqueKeyPerUser.GetKeyAsync(GetScriptsResponsePerUserCache.CacheName))" type="text/javascript"></script>
91+
}
92+
else
93+
{
94+
<script src="@(ApplicationPath)AbpScripts/GetScripts?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
95+
}

aspnet-core/src/AbpCompanyName.AbpProjectName.Web.Mvc/Views/Shared/Layout/_Scripts.cshtml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
@using System.Globalization
2+
@using Abp.AspNetCore.Mvc.Caching
3+
@using Abp.CachedUniqueKeys
24
@inject AbpCompanyName.AbpProjectName.Timing.AppTimes AppTimes
5+
@inject ICachedUniqueKeyPerUser CachedUniqueKeyPerUser
6+
@inject IGetScriptsResponsePerUserConfiguration GetScriptsResponsePerUserConfiguration
37

48
<environment names="Development">
59
@*core scripts start*@
@@ -92,4 +96,12 @@
9296

9397
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
9498
<script src="~/AbpServiceProxies/GetAll?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
95-
<script src="~/AbpScripts/GetScripts?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
99+
100+
@if (GetScriptsResponsePerUserConfiguration.IsEnabled)
101+
{
102+
<script src="@(ApplicationPath)AbpScripts/GetScripts?v=@(await CachedUniqueKeyPerUser.GetKeyAsync(GetScriptsResponsePerUserCache.CacheName))" type="text/javascript"></script>
103+
}
104+
else
105+
{
106+
<script src="@(ApplicationPath)AbpScripts/GetScripts?v=@(AppTimes.StartupTime.Ticks)" type="text/javascript"></script>
107+
}

0 commit comments

Comments
 (0)