<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Network cache: old pages returned by disk cache on history navigation after session is restored"
   href="https://bugs.webkit.org/show_bug.cgi?id=153230#c25">Comment # 25</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Network cache: old pages returned by disk cache on history navigation after session is restored"
   href="https://bugs.webkit.org/show_bug.cgi?id=153230">bug 153230</a>
              from <span class="vcard"><a class="email" href="mailto:cdumez&#64;apple.com" title="Chris Dumez &lt;cdumez&#64;apple.com&gt;"> <span class="fn">Chris Dumez</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=153230#c24">comment #24</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=153230#c23">comment #23</a>)
&gt; &gt; Comment on <span class=""><a href="attachment.cgi?id=270743&amp;action=diff" name="attach_270743" title="Try to fix mac builds">attachment 270743</a> <a href="attachment.cgi?id=270743&amp;action=edit" title="Try to fix mac builds">[details]</a></span>
&gt; &gt; Try to fix mac builds
&gt; &gt; 
&gt; &gt; View in context:
&gt; &gt; <a href="https://bugs.webkit.org/attachment.cgi?id=270743&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=270743&amp;action=review</a>
&gt; &gt; 
&gt; &gt; I think Sam or Anders need to review this.
&gt; &gt; 
&gt; &gt; &gt; Source/WebCore/ChangeLog:11
&gt; &gt; &gt; +        policy cache to ensure it's revalidated by the disk cache if needed.
&gt; &gt; 
&gt; &gt; I would say &quot;to ensure we do not use stale cached data in this case&quot;. As
&gt; &gt; this seems to be the intent.
&gt; 
&gt; Not really, we might still use the cached data if the revalidation is not
&gt; needed, which is what happens very often. If you close the browser, and then
&gt; open it, most of the resources are used from the disk cache without
&gt; revalidation (responseNeedsRevalidation returns false).</span >

I know we still want to use cached data if it is fresh ( does not need revalidation or revalidation succeeded). I still think my sentence is correct. Stale != cached. Stale data is data that has expired and is no longer fresh.

<span class="quote">&gt; &gt; &gt; Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1199
&gt; &gt; &gt; +    // iOS always want stale data for history navigation.
&gt; &gt; 
&gt; &gt; 'wants'.
&gt; &gt; 
&gt; &gt; I don't quite get this comment because it is not just iOS, so does everyone
&gt; &gt; else. The only case some platforms do not want stale data is for session
&gt; &gt; restore (Which used to be considered as a history navigation but does not
&gt; &gt; really have to).
&gt; 
&gt; Well, that's what I meant with &quot;always&quot;, but I agree it's not clear enough.
&gt; When a session is restored, the back forward list is also restored, and it
&gt; contains the current item as well. So, if you go back/forward after a
&gt; session restore, it's indeed a history navigation. And the fact that we do a
&gt; history navigation for the current item too is because it's also restored in
&gt; the back forward list, if we do a normal navigation we duplicate the entry
&gt; in the bf list, so going back after session restore would load the same page
&gt; again.
&gt; 
&gt; &gt; &gt; Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1218
&gt; &gt; &gt; +    m_page-&gt;goToItem(*item, frameLoadTypeForBackForwardItem(backForwardItemID, FrameLoadType::Forward));
&gt; &gt; 
&gt; &gt; So we will use SessionRestoredBackForward on iOS even though this has
&gt; &gt; nothing to do with session restore? This seems wrong.
&gt; 
&gt; No, on iOS frameLoadTypeForBackForwardItem always returns the proposed type,
&gt; FrameLoadType::Forward in this case, so this patch doesn't affect iOS at
&gt; all. For other ports SessionRestoredBackForward is only returned for history
&gt; items created for a session restore. So, this has to do with session restore
&gt; if the item we are about to navigate to was created from the session data.
&gt; 
&gt; &gt; &gt; Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1233
&gt; &gt; &gt; +    m_page-&gt;goToItem(*item, frameLoadTypeForBackForwardItem(backForwardItemID, FrameLoadType::Back));
&gt; &gt; 
&gt; &gt; ditto.
&gt; 
&gt; iOS will use FrameLoadType::Back here, not SessionRestoredBackForward.
&gt; 
&gt; &gt; &gt; Source/WebKit2/WebProcess/WebPage/WebPage.cpp:1248
&gt; &gt; &gt; +    m_page-&gt;goToItem(*item, frameLoadTypeForBackForwardItem(backForwardItemID, FrameLoadType::IndexedBackForward));
&gt; &gt; 
&gt; &gt; ditto, this is not only used for session restore.
&gt; 
&gt; This is not about restoring the session, but about navigation to a history
&gt; item that has been restored from the session. If we only care about the
&gt; actual navigation that happens right after the session restore, we would
&gt; show updated contents for the current page, but if then you go back, you
&gt; could see very old contents again.</span ></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>