whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: fully qualify bootstrap url and bypass cache
Date Tue, 07 Nov 2017 20:51:34 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 70a8830  fully qualify bootstrap url and bypass cache
70a8830 is described below

commit 70a883051a107a1f5a1665c185ab7a7243b36d78
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Tue Nov 7 15:51:06 2017 -0500

    fully qualify bootstrap url and bypass cache
---
 www/board/agenda/views/models/pagecache.js.rb | 3 ++-
 www/board/agenda/views/sw.js.rb               | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/www/board/agenda/views/models/pagecache.js.rb b/www/board/agenda/views/models/pagecache.js.rb
index dc7472c..0fa291d 100644
--- a/www/board/agenda/views/models/pagecache.js.rb
+++ b/www/board/agenda/views/models/pagecache.js.rb
@@ -37,7 +37,8 @@ class PageCache
 
     caches.open('board/agenda').then do |cache|
       # add bootstrap.html to the cache
-      request = Request.new('bootstrap.html')
+      base = document.getElementsByTagName('base')[0].href
+      request = Request.new(base + 'bootstrap.html', cache: "no-store")
       cache.match(request).then do |response|
         unless response
           fetch(request).then do |response|
diff --git a/www/board/agenda/views/sw.js.rb b/www/board/agenda/views/sw.js.rb
index 20e64c8..5e1f301 100644
--- a/www/board/agenda/views/sw.js.rb
+++ b/www/board/agenda/views/sw.js.rb
@@ -34,8 +34,8 @@ self.addEventListener :fetch do |event|
     event.respondWith(
       Promise.new do |fulfill, reject|
         date =  url.split('/')[0]
-        bootstrap = "#{date}/bootstrap.html"
-        request = Request.new(bootstrap)
+        bootstrap = "#{scope}/#{date}/bootstrap.html"
+        request = Request.new(bootstrap, cache: "no-store")
         error = nil
         timeoutId = nil
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message