{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleChrome/workbox/issues/1329","repository_url":"https://api.github.com/repos/GoogleChrome/workbox","labels_url":"https://api.github.com/repos/GoogleChrome/workbox/issues/1329/labels{/name}","comments_url":"https://api.github.com/repos/GoogleChrome/workbox/issues/1329/comments","events_url":"https://api.github.com/repos/GoogleChrome/workbox/issues/1329/events","html_url":"https://github.com/GoogleChrome/workbox/issues/1329","id":299515838,"number":1329,"title":"maxAgeSeconds","user":{"login":"JasonMuteham","id":30329835,"avatar_url":"https://avatars3.githubusercontent.com/u/30329835?v=4","gravatar_id":"","url":"https://api.github.com/users/JasonMuteham","html_url":"https://github.com/JasonMuteham","followers_url":"https://api.github.com/users/JasonMuteham/followers","following_url":"https://api.github.com/users/JasonMuteham/following{/other_user}","gists_url":"https://api.github.com/users/JasonMuteham/gists{/gist_id}","starred_url":"https://api.github.com/users/JasonMuteham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JasonMuteham/subscriptions","organizations_url":"https://api.github.com/users/JasonMuteham/orgs","repos_url":"https://api.github.com/users/JasonMuteham/repos","events_url":"https://api.github.com/users/JasonMuteham/events{/privacy}","received_events_url":"https://api.github.com/users/JasonMuteham/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-02-22T21:32:28Z","updated_at":"2018-04-10T10:46:12Z","closed_at":null,"author_association":"NONE","body":"The following code updates the cache but always hits the network .  However if maxAgeSeconds is removed it works as expected.\r\n\r\n```javascript\r\nworkbox.routing.registerRoute(\r\n  new RegExp(\"https://res.cloudinary.com/(.*)\"),\r\n  workbox.strategies.cacheFirst({\r\n      cacheName: 'cloud-images',\r\n      plugins: [\r\n        new workbox.expiration.Plugin({\r\n          maxAgeSeconds: 30 * 24 * 60 * 60,\r\n          maxEntries: 100,\r\n        }),\r\n        new workbox.cacheableResponse.Plugin({\r\n          statuses: [0, 200],\r\n        }),\r\n      ],\r\n  }),\r\n);\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/GoogleChrome/workbox/issues/comments/380056086","html_url":"https://github.com/GoogleChrome/workbox/issues/1329#issuecomment-380056086","issue_url":"https://api.github.com/repos/GoogleChrome/workbox/issues/1329","id":380056086,"user":{"login":"jorgeuriarte","id":46843,"avatar_url":"https://avatars0.githubusercontent.com/u/46843?v=4","gravatar_id":"","url":"https://api.github.com/users/jorgeuriarte","html_url":"https://github.com/jorgeuriarte","followers_url":"https://api.github.com/users/jorgeuriarte/followers","following_url":"https://api.github.com/users/jorgeuriarte/following{/other_user}","gists_url":"https://api.github.com/users/jorgeuriarte/gists{/gist_id}","starred_url":"https://api.github.com/users/jorgeuriarte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorgeuriarte/subscriptions","organizations_url":"https://api.github.com/users/jorgeuriarte/orgs","repos_url":"https://api.github.com/users/jorgeuriarte/repos","events_url":"https://api.github.com/users/jorgeuriarte/events{/privacy}","received_events_url":"https://api.github.com/users/jorgeuriarte/received_events","type":"User","site_admin":false},"created_at":"2018-04-10T10:46:12Z","updated_at":"2018-04-10T10:46:12Z","author_association":"NONE","body":"```\r\n  _getDateHeaderTimestamp(cachedResponse) {\r\n    const dateHeader = cachedResponse.headers.get('date');\r\n    const parsedDate = new Date(dateHeader);\r\n    const headerTime = parsedDate.getTime();\r\n\r\n    // If the Date header was invalid for some reason, parsedDate.getTime()\r\n    // will return NaN.\r\n    if (isNaN(headerTime)) {\r\n      return null;\r\n    }\r\n\r\n    return headerTime;\r\n  }\r\n```\r\n\r\nthis code will return `0` in my case... :( "}}
{"actor":{"display_login":"jorgeuriarte"}}