{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/create-react-app/issues/1910","repository_url":"https://api.github.com/repos/facebook/create-react-app","labels_url":"https://api.github.com/repos/facebook/create-react-app/issues/1910/labels{/name}","comments_url":"https://api.github.com/repos/facebook/create-react-app/issues/1910/comments","events_url":"https://api.github.com/repos/facebook/create-react-app/issues/1910/events","html_url":"https://github.com/facebook/create-react-app/issues/1910","id":218291435,"number":1910,"title":"Index.html is being cached making the whole app display an old build","user":{"login":"jlubeck","id":3067603,"avatar_url":"https://avatars3.githubusercontent.com/u/3067603?v=4","gravatar_id":"","url":"https://api.github.com/users/jlubeck","html_url":"https://github.com/jlubeck","followers_url":"https://api.github.com/users/jlubeck/followers","following_url":"https://api.github.com/users/jlubeck/following{/other_user}","gists_url":"https://api.github.com/users/jlubeck/gists{/gist_id}","starred_url":"https://api.github.com/users/jlubeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlubeck/subscriptions","organizations_url":"https://api.github.com/users/jlubeck/orgs","repos_url":"https://api.github.com/users/jlubeck/repos","events_url":"https://api.github.com/users/jlubeck/events{/privacy}","received_events_url":"https://api.github.com/users/jlubeck/received_events","type":"User","site_admin":false},"labels":[{"id":554733913,"url":"https://api.github.com/repos/facebook/create-react-app/labels/issue:%20question","name":"issue: question","color":"006b75","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":36,"created_at":"2017-03-30T18:44:44Z","updated_at":"2018-02-09T23:13:15Z","closed_at":"2017-04-01T00:02:04Z","author_association":"NONE","body":"So I have a page in production and some of my clients are complaining that they can't see the new changes unless they completely wipe their cache. \r\n\r\nI understand that the random hash on the js and css files are to prevent caching issues, but what about the index file itself? What can I do to prevent this file from being cached?\r\n\r\nThank you"},"comment":{"url":"https://api.github.com/repos/facebook/create-react-app/issues/comments/364596344","html_url":"https://github.com/facebook/create-react-app/issues/1910#issuecomment-364596344","issue_url":"https://api.github.com/repos/facebook/create-react-app/issues/1910","id":364596344,"user":{"login":"mostafa69d","id":25212827,"avatar_url":"https://avatars2.githubusercontent.com/u/25212827?v=4","gravatar_id":"","url":"https://api.github.com/users/mostafa69d","html_url":"https://github.com/mostafa69d","followers_url":"https://api.github.com/users/mostafa69d/followers","following_url":"https://api.github.com/users/mostafa69d/following{/other_user}","gists_url":"https://api.github.com/users/mostafa69d/gists{/gist_id}","starred_url":"https://api.github.com/users/mostafa69d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mostafa69d/subscriptions","organizations_url":"https://api.github.com/users/mostafa69d/orgs","repos_url":"https://api.github.com/users/mostafa69d/repos","events_url":"https://api.github.com/users/mostafa69d/events{/privacy}","received_events_url":"https://api.github.com/users/mostafa69d/received_events","type":"User","site_admin":false},"created_at":"2018-02-09T23:13:14Z","updated_at":"2018-02-09T23:13:14Z","author_association":"NONE","body":"I'm writing this comment to confirm the same problem with registerServiceWorker.(I'm not sure if it's an issue or an expected behaviour) \r\nI developed a very simple to do app with create-react-app and Express.js.(you can visit the running app on heroku from [here](https://awsome-do-app.herokuapp.com). The only part made problem was Google Auth. For authentication as you know we should redirect the user to Google and the rest of the scenario. \r\n Everything was working well on Local because I use a proxy to pass the api requests to server. For deployment as always I added a handler:\r\n```\r\nif (process.env.NODE_ENV === 'production') {\r\n    app.use(express.static('frontend/build'));\r\n\r\n    const path = require('path');\r\n\r\n    app.get('/*', (req, res) => {\r\n\r\n        res.sendFile(path.resolve(__dirname, 'frontend', 'build', 'index.html'));\r\n\r\n    });\r\n\r\n}\r\n```\r\nIt didn't work! When I tried to use Google Auth on the app I encountered the 404. **I surprised when app worked perfectly on Safari but not on Chrome, Firefox etc.**\r\nI searched over StackOverflow and Github and tried everything suggested but none of them worked. \r\nAfter hours and hours of debugging and tracking the logs on server I found the server doesn't serve index.html! I tried my app again on Chrome and Firefox but this time before that I used 'empty cache and hard reload' on chrome. And It worked!. I thought maybe it was just a simple caching by browser and it works after clearing the cache. But it didn't. Actually anytime I tried to get to a route which wasn't a part of react-router like '/auth/google' I had to ' clear cache and hard reload' to make it works.\r\nAfter millions of years I landed here on this page and as @webmobiles suggested(A big thanks to You) I used `unregister()` and now finally it's working as I expected.\r\nStill I don't know it's a problem with create-react-app, react-router, Express, Passport Js or Heroku! But in my case using 'unregister()' and removing registerServiceWorker as @gaearon and webmobiles  mentioned solved my problem.\r\nIn case you want to see my code it's available [here](https://github.com/mostafa69d/react-to-do-app/tree/master/server) on my GitHub.\r\n"}}
{"actor":{"display_login":"mostafa69d"}}