Skip to content

Commit 8ffc453

Browse files
committed
Prevent caching of AbpScripts.
1 parent 6a2306f commit 8ffc453

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/AbpCompanyName.AbpProjectName.WebMpa/Views/Shared/_Layout.cshtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@using System.Threading
22
@using System.Web.Optimization
3+
@using Abp.Timing
34
<!DOCTYPE html>
45
<html lang="en">
56
<head>
@@ -50,7 +51,7 @@
5051

5152
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
5253
<script src="~/api/AbpServiceProxies/GetAll"></script>
53-
<script src="~/AbpScripts/GetScripts" type="text/javascript"></script>
54+
<script src="~/AbpScripts/GetScripts?v=@(Clock.Now.Ticks)" type="text/javascript"></script>
5455

5556
<!-- View specific scripts -->
5657
@RenderSection("scripts", required: false)

src/AbpCompanyName.AbpProjectName.WebSpaAngular/App/Main/views/layout/layout.cshtml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@using System.Threading
22
@using System.Web.Optimization
3+
@using Abp.Timing
34
<!DOCTYPE html>
45
<html lang="en">
56
<head>
@@ -35,7 +36,7 @@
3536

3637
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
3738
<script src="~/api/AbpServiceProxies/GetAll?type=angular"></script>
38-
<script src="~/AbpScripts/GetScripts" type="text/javascript"></script>
39+
<script src="~/AbpScripts/GetScripts?v=@(Clock.Now.Ticks)" type="text/javascript"></script>
3940

4041
@Scripts.Render("~/Bundles/App/Main/js")
4142

src/AbpCompanyName.AbpProjectName.WebSpaAngular/Views/Shared/_Layout.cshtml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@*
1+
@using Abp.Timing
2+
@*
23
IMPORTANT NOTES FROM ASP.NET BOILERPLATE:
34
45
This _Layout.cshtml is not used actually. It's left here if you want to add some classic style (MPA)
@@ -65,7 +66,7 @@
6566

6667
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
6768
<script src="~/api/AbpServiceProxies/GetAll"></script>
68-
<script src="~/AbpScripts/GetScripts" type="text/javascript"></script>
69+
<script src="~/AbpScripts/GetScripts?v=@(Clock.Now.Ticks)" type="text/javascript"></script>
6970
</head>
7071
<body>
7172
@RenderBody()

0 commit comments

Comments
 (0)