Skip to content

Commit 333e45c

Browse files
committed
Prevent caching of abp dynamic scripts.
1 parent 39e444e commit 333e45c

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

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

Lines changed: 3 additions & 2 deletions
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>
@@ -49,8 +50,8 @@
4950
</script>
5051

5152
<!-- Dynamic scripts of ABP system (They are created on runtime and can not be bundled) -->
52-
<script src="~/api/AbpServiceProxies/GetAll"></script>
53-
<script src="~/AbpScripts/GetScripts" type="text/javascript"></script>
53+
<script src="~/api/AbpServiceProxies/GetAll?v=@(Clock.Now.Ticks)"></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: 4 additions & 3 deletions
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>
@@ -34,9 +35,9 @@
3435
</script>
3536

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

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

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@using Abp.Web.Mvc.Extensions
1+
@using Abp.Timing
2+
@using Abp.Web.Mvc.Extensions
23
@*
34
IMPORTANT NOTES FROM ASP.NET BOILERPLATE:
45
@@ -64,8 +65,8 @@
6465
@Html.IncludeScript("~/Abp/Framework/scripts/libs/abp.sweet-alert.js")
6566

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

7071
@RenderSection("Scripts", false)
7172
</head>

0 commit comments

Comments
 (0)