Skip to main content

Service worker view patch does not working in cached

Gems / Libraries • Asked by abdul544

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


  ]);
})

);
}


Login or Create An Account to join the conversation.

Subscribe to the newsletter

Join 24,647+ developers who get early access to new screencasts, articles, guides, updates, and more.

    By clicking this button, you agree to the GoRails Terms of Service and Privacy Policy.

    More of a social being? We're also on Twitter and YouTube.