Commit 51a2c2f1 authored by Michał Woźniak's avatar Michał Woźniak
Browse files

WIP #71: cache self.log() bugfix

parent 2f047a0b
......@@ -23,7 +23,7 @@
* getting content from cache
*/
let getContentFromCache = (url) => {
self.log(config.name, 'getting from cache!')
self.log(config.name, `getting from cache: ${url}`)
return caches.open('v1')
.then((cache) => {
return cache.match(url)
......@@ -32,13 +32,11 @@
if (typeof response === 'undefined') {
throw new Error('Resource not found in cache');
} else {
self.log(
config.name,
'retrieved cached headers:\n',
response.headers.map((v, k)=>{
return `${k} : ${v}`
}).join('\n+-- ')
)
var msg = 'retrieved cached headers:'
response.headers.forEach((v, k)=>{
msg += `\n+-- ${k} : ${v}`
})
self.log(config.name, msg)
// return the response
return response
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment