@@ -0,0 +1,14 @@
1+---
2+layout: post
3+---
4+
5+The Back Button, the Ajax, and the Chrome
6+-----------------------------------------
7+
8+Sunnyvale, Feb 28, 2013
9+
10+Yesterday I came across a weird situation, that only happens on chrome (*shocking*!).
11+
12+At work, we have implemented `/search` as both a JSON endpoint and a HTML page. We choose what we send out depending on the `x-requested-with` header. Unfortunately doing this without any precaution, makes Chrome think that the latest response from `/search` xhr or page refresh is the latest version of `/search`. So when we try to navigate back to search, we get the JSON dump of the last executed search. This is simply resolved by adding a cache buster to the querystring, in our case that looks …
13+
14+Hope this helps someone debug the problem faster, and understand it.