The back button cache – taming it with HTML 5
sitekickr.com
sitekickr.com
There might be ways to solve these issues, but it's definitely more complex than a snippet of JS. Amazon's solution, while requiring an additional HTTP request, is more reliable, and probably more maintainable too.
It would be up to the developer to tailor the this to their needs. For instance, adding an unload event to prevent sync issues.
Sometimes improving performance requires a more complex solution, sometimes a less complex solution. It all depends how bad you want to avoid that AJAX call!