mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Normalize the service worker route (#8359)
* FEATURE: Normalize the service worker route Update cache headers so they are not immutable outside of the rails app Add the ability to purge the service worker cache from localhost Rails -> nginx will pass immutable flags so the file is cached until reloaded. In most cases, nginx will have its cache flushed on rebuild (new image) For those needing dynamic re-caching (such as upgrading via the UI), a rake task for flushing the service worker script is provided through `assets:flush_sw`
This commit is contained in:
@@ -456,8 +456,6 @@ module ApplicationHelper
|
||||
end
|
||||
|
||||
def client_side_setup_data
|
||||
service_worker_url = Rails.env.development? ? 'service-worker.js' : Rails.application.assets_manifest.assets['service-worker.js']
|
||||
|
||||
setup_data = {
|
||||
cdn: Rails.configuration.action_controller.asset_host,
|
||||
base_url: Discourse.base_url,
|
||||
@@ -465,7 +463,7 @@ module ApplicationHelper
|
||||
environment: Rails.env,
|
||||
letter_avatar_version: LetterAvatar.version,
|
||||
markdown_it_url: script_asset_path('markdown-it-bundle'),
|
||||
service_worker_url: service_worker_url,
|
||||
service_worker_url: 'service-worker.js',
|
||||
default_locale: SiteSetting.default_locale,
|
||||
asset_version: Discourse.assets_digest,
|
||||
disable_custom_css: loading_admin?,
|
||||
|
||||
Reference in New Issue
Block a user