recidive / choko

Choko Framework
http://choko.org
MIT License
25 stars 9 forks source link

Application breaks on back button #192

Open recidive opened 10 years ago

recidive commented 10 years ago

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 commented 9 years ago

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.