All threads / Service worker view patch does not working in cached

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Service worker view patch does not working in cached

abdul544 asked in Gems / Libraries

I want to add a view file inside cached but it doesn't work.
How to call view Patch in cache?
//serviceworker.js.erb
ar CACHE_VERSION = 'v1';
var CACHE_NAME = CACHE_VERSION + ':sw-cache-';

function onInstall(event) {
console.log('[Serviceworker]', "Installing!", event);
event.waitUntil(
caches.open(CACHE_NAME).then(function prefill(cache) {
return cache.addAll([

    // make sure serviceworker.js is not required by application.js
    // if you want to reference application.js from here
    '<%#= asset_path "application.js" %>',

    '<%= asset_path "application.css" %>',

    '/offline.html',
            **'/views/user/index.haml' ** //Uncaught (in promise) TypeError: Request failed


  ]);
})

);
}

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 33,665+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.