Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handling re-caching after new application version deployment? #852

Closed
xzilja opened this issue Aug 10, 2016 · 19 comments
Closed

Handling re-caching after new application version deployment? #852

xzilja opened this issue Aug 10, 2016 · 19 comments
Labels

Comments

@xzilja
Copy link

xzilja commented Aug 10, 2016

I found myself deploying code to production today and not seeing any updates in the application, only after I deleted all cache in the website I was able to see my changes leading to my question. What is correct way to handle re-cache of the website when new feature is deployed to production?

@mxstbr
Copy link
Member

mxstbr commented Aug 10, 2016

Well the one thing you really want to uncache is the index.html file. Since it references the new files, once users get the new version of that they'll have the new version of the app.

Not sure if that answers the question? I guess an automatic setup would be nice but that strongly depends on how you deploy…

@xzilja
Copy link
Author

xzilja commented Aug 10, 2016

@mxstbr Sure thing, but I'm just thinking of how to actually achieve it, i.e. assume deployment to heroku for example, what can the steps / places be where I'd need to do un-caching? is it on the serverside or can I do it during build?

@elswenson
Copy link

I ran into similar issues when using this boilerplate for an application served as static pages. The offline plugin made browsers run the scripts from the cached worker rather than grabbing a new one from the host (until I manually cleared them from the browser cache); even if each item in the build had a hashed name and the CDN was configured for a short cache period.

@mxstbr
Copy link
Member

mxstbr commented Aug 15, 2016

That should definitely not happen! @NekR any ideas?

@NekR
Copy link
Contributor

NekR commented Aug 15, 2016

Well, this question is raised each month or so. Here is the answer: https://github.com/NekR/offline-plugin/blob/master/docs/updates.md

If that doc doesn't help, please provide detailed steps about how you are trying to update website. All steps, e.g. what you do with build and what you do with browser.

@maheffa
Copy link

maheffa commented Aug 17, 2016

I'm facing the same issue with my project. For some reason, index.html doesn't get updated. I always end up loading the old version of it, which points to a different main.<hash>.js than what have been generated during the latest build. I always have to do an Empty cache and hard reload on Chrome in order to get the correct version.

@NekR
Copy link
Contributor

NekR commented Aug 17, 2016

Again, this doesn't help without details. All what you describe is a
problem in general which could even not a problem, but just understanding.
Please if you post in this thread, confirm that you read mentioned doc and
steps described there didn't help you. Thanks.

On Aug 17, 2016 2:31 PM, "maheffa" notifications@github.com wrote:

I'm facing the same issue with my project. For some reason, index.html
doesn't get updated. I always end up loading the old version of it, which
points to a different main..js than what have been generated during
the latest build. I always have to do an Empty cache and hard reload on
Chrome in order to get the correct version.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#852 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABIlkQw_E39EKrZ_PhOZTFWDeqbnDoUMks5qgvD2gaJpZM4JhMuZ
.

@NekR
Copy link
Contributor

NekR commented Aug 17, 2016

@mxstbr

Well the one thing you really want to uncache is the index.html file. Since it references the new files, once users get the new version of that they'll have the new version of the app.

I don't think it's the issue. HTML files might be cached and it's totally fine.

@NekR
Copy link
Contributor

NekR commented Sep 1, 2016

@mxstbr should we close this?

@elswenson
Copy link

Since you said this question is raised every month or so, would it make sense for there to be even just a small note in the documentation for react-boilerplate to seek out the documentation for offline-plugin?

While finding the library documentation is an obvious next-step for more experienced developers, it might reduce the redundant questions, if nothing else?

@NekR
Copy link
Contributor

NekR commented Sep 2, 2016

@elswenson it probably makes sense, but it's up to this' repo maintainers to add it or not. If there is a FAQ or Notes section somewhere here, when that would be perfect place for such a note.

@mxstbr mxstbr closed this as completed Sep 2, 2016
@mxstbr
Copy link
Member

mxstbr commented Sep 2, 2016

Yeah sure, there is a FAQ! A PR adding this to the FAQ would be much appreciated 👍

@NekR
Copy link
Contributor

NekR commented Sep 2, 2016

@mxstbr if I'll have time, too much to handle already 🙂

@gihrig
Copy link
Contributor

gihrig commented Oct 5, 2016

@mxstbr Well the one thing you really want to uncache is the index.html file. Since it references the new files, once users get the new version of that they'll have the new version of the app.

@NekR I don't think it's the issue. HTML files might be cached and it's totally fine.

@NekR if I'll have time, too much to handle already

@NekR Could you provide a rough outline of what you had in minder to add to the FAQ? Then others can polish it up and open a PR. - Thanks

@NekR
Copy link
Contributor

NekR commented Oct 6, 2016

@gihrig I meant something like this: "Your production site isn't working? You update the code and nothing changes? It drives you insane? Here is the answer -- https://github.com/NekR/offline-plugin/blob/master/docs/updates.md"

@gihrig
Copy link
Contributor

gihrig commented Oct 6, 2016

@NekR That's perfect, thanks!

@Vadorequest Would you like to open a PR with these changes to FAQ.md ?

In FAQ we should also include the 'workaround' steps discussed in #1074 OP.

@Vadorequest
Copy link
Contributor

@gihrig Done at #1081

@gihrig
Copy link
Contributor

gihrig commented Oct 6, 2016

FAQ updated.

Thanks @Vadorequest 🎉

@lock
Copy link

lock bot commented May 30, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants