{"action":"closed","issue":{"url":"https://api.github.com/repos/jhollingworth/marty/issues/196","labels_url":"https://api.github.com/repos/jhollingworth/marty/issues/196/labels{/name}","comments_url":"https://api.github.com/repos/jhollingworth/marty/issues/196/comments","events_url":"https://api.github.com/repos/jhollingworth/marty/issues/196/events","html_url":"https://github.com/jhollingworth/marty/issues/196","id":61479653,"number":196,"title":"Prevent raw JSON when using browser's back button","user":{"login":"bigardone","id":1090272,"avatar_url":"https://avatars.githubusercontent.com/u/1090272?v=3","gravatar_id":"","url":"https://api.github.com/users/bigardone","html_url":"https://github.com/bigardone","followers_url":"https://api.github.com/users/bigardone/followers","following_url":"https://api.github.com/users/bigardone/following{/other_user}","gists_url":"https://api.github.com/users/bigardone/gists{/gist_id}","starred_url":"https://api.github.com/users/bigardone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bigardone/subscriptions","organizations_url":"https://api.github.com/users/bigardone/orgs","repos_url":"https://api.github.com/users/bigardone/repos","events_url":"https://api.github.com/users/bigardone/events{/privacy}","received_events_url":"https://api.github.com/users/bigardone/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jhollingworth/marty/labels/invalid","name":"invalid","color":"e6e6e6"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-14T07:33:45Z","updated_at":"2015-03-16T18:42:34Z","closed_at":"2015-03-16T18:42:34Z","body":"Hi!\r\nI'm developing a Rails app and I've found some cases where  a user clicks the back button and the browser renders the last request as raw JSON. This seems to be because the browser serves the last cached response for a certain URL so if the user visits ```/collections``` and the app serves a collections page where it renders a **CollectionList** React component which uses that uses a **HTTP state source** which retrieves the data from the same URL but as JSON then when clicking into a collection to see it's details and then going back to the list by clicking the browser's back button the raw JSON will be displayed.\r\nI've seen that this can be prevented in jQuery by setting the **cache** param to false when doing ajax requests (http://api.jquery.com/jQuery.ajax/) and I was wondering if this could be done in Marty too. \r\nAnother solution I can implement is to separate all the JSON requests to a different API controller but I wanted first to share this with you to see if adding something like a **cache: false** to Marty would work :)\r\nThanks in advance!"}}