{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleChrome/workbox/issues/1434","repository_url":"https://api.github.com/repos/GoogleChrome/workbox","labels_url":"https://api.github.com/repos/GoogleChrome/workbox/issues/1434/labels{/name}","comments_url":"https://api.github.com/repos/GoogleChrome/workbox/issues/1434/comments","events_url":"https://api.github.com/repos/GoogleChrome/workbox/issues/1434/events","html_url":"https://github.com/GoogleChrome/workbox/issues/1434","id":314601676,"number":1434,"title":"NetworkFirst caches empty with Apache2 but OK with node.js ","user":{"login":"Antoinebr","id":8248256,"avatar_url":"https://avatars0.githubusercontent.com/u/8248256?v=4","gravatar_id":"","url":"https://api.github.com/users/Antoinebr","html_url":"https://github.com/Antoinebr","followers_url":"https://api.github.com/users/Antoinebr/followers","following_url":"https://api.github.com/users/Antoinebr/following{/other_user}","gists_url":"https://api.github.com/users/Antoinebr/gists{/gist_id}","starred_url":"https://api.github.com/users/Antoinebr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Antoinebr/subscriptions","organizations_url":"https://api.github.com/users/Antoinebr/orgs","repos_url":"https://api.github.com/users/Antoinebr/repos","events_url":"https://api.github.com/users/Antoinebr/events{/privacy}","received_events_url":"https://api.github.com/users/Antoinebr/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-16T11:03:07Z","updated_at":"2018-05-22T17:27:24Z","closed_at":"2018-05-22T17:27:24Z","author_association":"NONE","body":"I deployed a serviceworker created with workbox that's working on local and on production.\r\n\r\nBut the Network first caches are always empty on production, even is the pages got responses from the serviceWorker.\r\n\r\nIt's a big issue for me because I have to show the available offline pages when the users try to see a page not in the cache.\r\n\r\n\r\n```JavaScript \r\n\r\nimportScripts(\"https://storage.googleapis.com/workbox-cdn/releases/3.0.1/workbox-sw.js\");\r\n\r\nworkbox.core.setLogLevel(workbox.core.LOG_LEVELS.debug);\r\nworkbox.core.setLogLevel(1);\r\nworkbox.skipWaiting();\r\nworkbox.clientsClaim();\r\n\r\n\r\nself.__precacheManifest = [\r\n  {\r\n    \"url\": \"/bug/stylesheets/style.css\",\r\n    \"revision\": \"e348111mmlsitrezgmdppp72ss88067d\"\r\n  },\r\n  {\r\n    \"url\": \"/bug/offline/\",\r\n    \"revision\": \"e348111llmpouitrezgmdppp72ss88067d\"\r\n  }\r\n].concat(self.__precacheManifest || []);\r\n\r\n//workbox.precaching.suppressWarnings();\r\nworkbox.precaching.precacheAndRoute(self.__precacheManifest, {});\r\n\r\nworkbox.routing.registerRoute(/(https:\\/\\/fonts.googleapis.com)/, workbox.strategies.staleWhileRevalidate(), 'GET');\r\n\r\n\r\nvar networkFirstHandler = workbox.strategies.networkFirst({\r\n  cacheName: 'articles-antoine',\r\n  plugins: [\r\n    new workbox.expiration.Plugin({\r\n      maxEntries: 30\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\r\nconst handler = (args) => networkFirstHandler.handle(args).then((response) => (!response) ? caches.match('/offline/') : response);\r\n\r\nworkbox.routing.registerRoute(/\\/articles\\//, handler);\r\n\r\n ```\r\n\r\n\r\n## Reproduce the issue : \r\n\r\n* Go on : https://monbraceletnato.fr/bug/articles/?id=ddssd & https://monbraceletnato.fr/bug/articles/?id=ddssddLLL ( the files will be available offline, but the cache will remain empty )\r\n\r\n* With Node.js it's working : https://racooon.herokuapp.com/article/dds \r\n\r\n## Infos \r\n\r\n* The serviceworker is here : https://monbraceletnato.fr/bug/serviceworker.js\r\n\r\n\r\n\r\nThank you a lot for your help 👍 \r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/GoogleChrome/workbox/issues/comments/391074288","html_url":"https://github.com/GoogleChrome/workbox/issues/1434#issuecomment-391074288","issue_url":"https://api.github.com/repos/GoogleChrome/workbox/issues/1434","id":391074288,"user":{"login":"jeffposnick","id":1749548,"avatar_url":"https://avatars1.githubusercontent.com/u/1749548?v=4","gravatar_id":"","url":"https://api.github.com/users/jeffposnick","html_url":"https://github.com/jeffposnick","followers_url":"https://api.github.com/users/jeffposnick/followers","following_url":"https://api.github.com/users/jeffposnick/following{/other_user}","gists_url":"https://api.github.com/users/jeffposnick/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffposnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffposnick/subscriptions","organizations_url":"https://api.github.com/users/jeffposnick/orgs","repos_url":"https://api.github.com/users/jeffposnick/repos","events_url":"https://api.github.com/users/jeffposnick/events{/privacy}","received_events_url":"https://api.github.com/users/jeffposnick/received_events","type":"User","site_admin":false},"created_at":"2018-05-22T17:27:24Z","updated_at":"2018-05-22T17:27:24Z","author_association":"COLLABORATOR","body":"I think it might be possible to work around this sort of thing by explicitly including `ignoreVary` when performing the cache matches: https://developers.google.com/web/updates/2016/09/cache-query-options#ignoremethod_and_ignorevary\r\n\r\nBut... it's a bit of an edge case, and it's not clear that using `ignoreVary` would actually be a safe thing to do, so I think it's left up to each developer to figure out whether just removing the `Vary` headers completely, or using `ignoreVary`, makes more sense."}}
{"actor":{"display_login":"jeffposnick"}}