From 7af10a020d6d1200696eb77ae01b483e8d392d17 Mon Sep 17 00:00:00 2001 From: Jasper van Merle Date: Sun, 7 Jul 2019 14:19:04 +0200 Subject: [PATCH] Cache debug.js when not running in production --- docs/maintainers.md | 2 +- views/service-worker.js.erb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/maintainers.md b/docs/maintainers.md index 1369816d..455e6501 100644 --- a/docs/maintainers.md +++ b/docs/maintainers.md @@ -84,7 +84,7 @@ In addition to the [publicly-documented commands](https://github.com/freeCodeCam Once docs have been uploaded via `thor docs:upload` (if applicable), deploying DevDocs is as simple as running `git push heroku master`. See [Heroku's documentation](https://devcenter.heroku.com/articles/git) for more information. -- If you're deploying documentation updates, verify that the documentations work properly once the deploy is done (you will need to reload [devdocs.io](https://devdocs.io/) a couple times for the application cache to update and the new version to load). +- If you're deploying documentation updates, verify that the documentations work properly once the deploy is done (you will need to reload [devdocs.io](https://devdocs.io/) a couple times for the service worker to update and the new version to load). - If you're deploying frontend changes, monitor [Sentry](https://sentry.io/devdocs/devdocs-js/) for new JS errors once the deploy is done. - If you're deploying server changes, monitor New Relic (accessible through [the Heroku dashboard](https://dashboard.heroku.com/apps/devdocs)) for Ruby exceptions and throughput or response time changes once the deploy is done. diff --git a/views/service-worker.js.erb b/views/service-worker.js.erb index e9028f4d..e2986ede 100644 --- a/views/service-worker.js.erb +++ b/views/service-worker.js.erb @@ -14,7 +14,8 @@ const cachePaths = [ '/images/webapp-icon-256.png', '/images/webapp-icon-512.png', '<%= manifest_asset_urls.join "',\n '" %>', - '<%= doc_index_urls.join "',\n '" %>', + '<%= doc_index_urls.join "',\n '" %>',<% unless App.production? %> + '<%= javascript_path('debug') %>',<% end %> ]; <%# Set-up the cache %>