Update shell version when admin action taken (#11343)

* Update shell version when admin action taken

* Update app/controllers/admin/application_controller.rb

Co-authored-by: Alex <alexandersmith223@gmail.com>

Co-authored-by: Alex <alexandersmith223@gmail.com>
This commit is contained in:
Ben Halpern 2020-11-09 15:31:54 -05:00 committed by GitHub
parent a0c174fcb7
commit dfc3d96286
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 2 deletions

View file

@ -17,6 +17,7 @@ module Admin
CacheBuster.bust("/tags/onboarding") # Needs to change when suggested_tags is edited.
CacheBuster.bust("/shell_top") # Cached at edge, sent to service worker.
CacheBuster.bust("/shell_bottom") # Cached at edge, sent to service worker.
CacheBuster.bust("/async_info/shell_version") # Checks if current users should be busted.
CacheBuster.bust("/onboarding") # Page is cached at edge.
CacheBuster.bust("/") # Page is cached at edge.
SiteConfig.admin_action_taken_at = Time.current # Used as cache key

View file

@ -29,7 +29,7 @@ class AsyncInfoController < ApplicationController
set_surrogate_key_header "shell-version-endpoint"
# shell_version will change on every deploy.
# *Technically* could be only on changes to assets and shell, but this is more fool-proof.
shell_version = ApplicationConfig["RELEASE_FOOTPRINT"]
shell_version = ApplicationConfig["RELEASE_FOOTPRINT"] + SiteConfig.admin_action_taken_at.to_s
render json: { version: shell_version }.to_json
end

View file

@ -42,7 +42,6 @@
<link href="<%= optimized_image_url(SiteConfig.logo_png, width: 128, fetch_format: "png") %>" rel="icon" sizes="128x128" />
<meta name="apple-mobile-web-app-title" content="<%= SiteConfig.app_domain %>">
<meta name="application-name" content="<%= SiteConfig.app_domain %>">
<meta property="fb:pages" content="568966383279687" />
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="/manifest.json" />
<link rel="search" href="<%= URL.url("open-search.xml") %>" type="application/opensearchdescription+xml" title="<%= community_qualified_name %>" />