diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-14 16:52:03 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-14 16:53:15 +0200 |
| commit | ffb3c9987c2f820b99e8ad0ad56db8ae0324671c (patch) | |
| tree | 5f8ae79e6952cc6808ba5d5f827c98b6c78b62df /app/helpers/admin_helper.rb | |
| parent | c7ed30918154d801c44f77645ead38d4759d2778 (diff) | |
Extend static-asset cache-busting to the public layout
mtime_busted_path only ever covered the four admin-only static
files. The public layout has the identical exposure -- ccc.css,
glightbox's vendored CSS/JS, and public.js are all served straight
from public/ with no pipeline fingerprinting either -- just never
got the same treatment.
Diffstat (limited to 'app/helpers/admin_helper.rb')
| -rw-r--r-- | app/helpers/admin_helper.rb | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index 6c3cbc64..2684fffb 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb | |||
| @@ -7,10 +7,4 @@ module AdminHelper | |||
| 7 | link_to raw('<span class="inactive">Deutsch</span>'), url_for(params.permit(:locale, :page_path).to_h.merge('locale' => 'de')) | 7 | link_to raw('<span class="inactive">Deutsch</span>'), url_for(params.permit(:locale, :page_path).to_h.merge('locale' => 'de')) |
| 8 | end | 8 | end |
| 9 | end | 9 | end |
| 10 | |||
| 11 | def mtime_busted_path(path) | ||
| 12 | file = Rails.public_path.join(path.sub(%r{\A/}, "")) | ||
| 13 | raise "Static asset not found for cache-busting: #{path} (looked for #{file})" unless File.exist?(file) | ||
| 14 | "#{path}?v=#{File.mtime(file).to_i}" | ||
| 15 | end | ||
| 16 | end | 10 | end |
