Skip to content

Commit

Permalink
Added date based cache buster to client script (#19873)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike182uk committed Mar 18, 2024
1 parent 6849aa9 commit 15ed2eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ghost/admin/app/controllers/application.js
Expand Up @@ -27,6 +27,10 @@ export default class ApplicationController extends Controller {
return this.config.clientExtensions?.script;
}

get cacheBuster() {
return Date.now();
}

get showNavMenu() {
let {router, session, ui} = this;

Expand Down
2 changes: 1 addition & 1 deletion ghost/admin/app/templates/application.hbs
Expand Up @@ -40,7 +40,7 @@
{{#if this.showScriptExtension}}
{{{this.showScriptExtension.container}}}
{{!-- template-lint-disable no-forbidden-elements --}}
<script src="{{this.showScriptExtension.src}}"></script>
<script src="{{this.showScriptExtension.src}}?v={{this.cacheBuster}}"></script>
{{/if}}

{{#if this.settings.accentColor}}
Expand Down

0 comments on commit 15ed2eb

Please sign in to comment.