2

We are building our angular app with the cli. When we deploy it on our server, and navigate to our app. The old version of the app (components and templates) are received sometimes. Has anyone else experienced this? Solutions?

Thanks!

1
  • Sounds more of a server cache problem... Did you try to clear it? Commented Feb 20, 2018 at 15:40

1 Answer 1

1

You have to serve your index.html with no-cache or limited cache period. In Express, it looks like

app.use(function(req, res, next) {
   res.setHeader("Cache-Control", "public, max-age=0");
   return next();
});
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks you. We use nginx so I added that header in a similar way. Leaving the open for a few days to fully vet out. If we see no more issues I will marked this as the solution.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.