choko icon indicating copy to clipboard operation
choko copied to clipboard

Application breaks on back button

Open recidive opened this issue 10 years ago • 1 comments

When you navigate out of your application, e.g. clicking on an external link, when you click the browser back button it will return the JSON response for the page instead of the index.html.

I believe this happen since the browser loads the last response from the cache and in that case it was the JSON endpoint that's called by AngularJS.

To fix this, I believe we'll need to split paths, having the root "/" serving the index.html, or the SEO version of the page eventually, and "/rest/state/" for the page state endpoint. This way the browser should get the right cache on the back button.

recidive avatar Oct 17 '14 17:10 recidive

This ended up being more complex than I thought initially, since there are also routes that don't belong to states, such as /sign-out. We need something to threat those routes differently.

recidive avatar Mar 14 '15 16:03 recidive