title: JavaScript - bfcache/pageshow event - event.persisted always set to false?
body: <p>In a standard Java / SpringMVC / JSP / jQuery web-app, I'm trying to detect a "Back" (or history.go(-1)) event, in order to refresh (AJAX) a summary component/panel content when I return to a page (where we can change the backend data that is displayed by the summary component). </p>
  
  <p>I tried the following in JavaScript (following some posts on StackExchange re how to achieve this):</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
      window.onpageshow = function(event) {
          console.log("Event:");
          console.dir(event);
          if (event.persisted) {
              alert("non-jQuery - back to page - loaded from bfcache");
          } else {
              alert("non-jQuery - loaded page from server");
          }
      };
      $(window).on("pageshow", function(event){
          console.log("Event:");
          console.dir(event);
          if (event.originalEvent.persisted) {
              alert("jquery - back to page - loaded from bfcache");
          } else {
              alert("jquery - loaded page from server");
          }
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I am running OpenSUSE Linux and have tried this with FireFox and Chrome (latest versions), but every time the event's <code>persisted</code> attribute is set to <code>false</code> (I can see this in the JavaScript console and by the alerts that pop-up from the above code). By every time, I mean, regardless of whether it was loaded from the server or shown again via the Back button (or a 'Back' link).</p>
  
  <p>My intention was to make an AJAX call to reload the summary component/panel with the updated  data from the server if the page was showing via the Back button or <code>history.go(-1)</code> call.</p>
  
  <p>I also tried setting an unload handler (that does nothing) to prevent the page from being put into the bfcache but it still seems to be showing a bf-cached version and the <code>event.persisted</code> (or <code>event.originalEvent.persisted</code>) is set to <code>false</code>. </p>
  
  <p>Is this property managed correctly on Linux? Am I doing something stupid in my code? Any help or ideas would be much appreciated, thanks!</p>