10

Orion (and Safari) respect Cache-Control HTTP header directives. This leads to poor user experience which differs from other popular browsers.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control

On Orion and Safari, when you go back and forward through history on a site with a directive like 'max-age=0', the page reloads per the directive. This makes navigating through history tedious.

Other browsers (FF, Chromium-based) tend to not fully respect sites' Cache-Control directives. So moving back and forward in history does not reload every page, going back is basically instant and navigating through history is quick and painless.

Example site with 'max-age=0' is reddit.com. Note that going back or forward in history to a page on reddit.com reloads the page fully.

Example site without any Cache-Control directives is arstechnica.com. Note that going back and forward in history to a page on arstechnica.com does not reload the page, because it just renders the page from cache.

Note that on other browsers, on both sites, navigating through history loads the pages from the bfcache.

I suggest that Orion to provide an option to emulate the behaviour of other browsers, where it does not respect the Cache-Control directives when a site is navigated to via the back and forward buttons or shortcuts.

The end user can decide if they want pages to reload when going back and forward, or if they want pages to load from the cache.

The UI for the option could include some descriptive text noting that manual reloading of pages may be necessary with this option enabled.

  • Vlad replied to this.

    Cannabat It is a carefully presented argument and I can agree with you that it would lead to a better user experience.

    However I do not feel like being in the business of policing the web and fixing sites for the user by not following web standards. In this case I feel that Chrome and Firefox are doing disservice to the web because if enough users complained, reddit developers might actually spend 5 minutes what is needed to make their site work as intended.

      Vlad

      Perhaps this is better as a browser extension.

      Does Orion have a preference for Safari, Chrome or FF extensions?

      • Vlad replied to this.

        Cannabat Chrome and FF extensions are supported. Safari uses a closed format.

          I support this request because imo going back is fundamentally a different action from (re)loading a webpage in the eyes of users. What users want when going back is to return on their steps, the ideal would be to go back to the page as you left it. This is also why browsers (including Orion), and not web developers, make sure the page is scrolled back to the position it was when the users navigated away.

          From a user's point of view I should be able to disconnect my computer from the internet and the back/forward button in my browser should still work "infinitely" for the navigation history of that browser tab. That is the unreachable ideal, limited by limited RAM and disk cache.

          This only applies until the browser tab is closed, just like scrolling to the position you left off. Clicking a history item in the History menu or window implies making a new request to a previously visited page which is different from a back/forward navigation.

          Edit: imo this should be the default. Disabling this loading for cache on back/forward could be an advanced preference, although I think everyone that wants to see a newer version of the page they're on know how to reload that page easily so I don't even see a need for this preference tbh.

            pieterv This is how it works, unless the developer of the site explicitly said that the page should never be cached, like reddit did. reddit can fix this behavior by removing the cache-control directive. Would like to hear more thoughts from the community about this.

              Safari previously respected Cache-Control when the 2-finger swipe-between-pages gesture was enabled in macOS's Trackpad settings, but did not respect Cache-Control when clicking the Back/Forward buttons or using Cmd + [ and Cmd + ] keyboard shortcuts.

              A common fix was to disable the gesture and then use BetterTouchTool to map the same 2-finger swipe to the keyboard shortcuts. There are many fairly recent forum posts suggesting this. Based on the timing of posts, this must have changed in the past couple years as this fix no longer works. Cache-Control is always respected.

              Some users have abandoned Safari because of this "problem". It seems some users don't mind it, but those who do (like me) find the behaviour intolerable.


              Unfortunately, browser extensions apparently cannot modify the Cache-Control header:
              https://developer.chrome.com/docs/extensions/reference/webRequest/#life-cycle-of-requests
              https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/onBeforeSendHeaders

              I not sure how to find the relevant documentation for Safari's extension APIs, but I suppose it's the same.

              So, my idea to make an extension that handles this is not possible.

              Edit: I might not be understanding the extension API stuff correctly. I think you'd want to modify the Response header, right? But what I'm seeing in the API reference is that you can't modify the Request header... May be a bit out of my element here!

                Vlad Disclaimer: I'm not an expert on cache-control despite being a web developer myself.

                I think Reddit's cache-control value is correct though? Reddit should never be cached (for new requests). When navigating to Reddit I want the most up-to-date version of that page, when reloading Reddit after just having scrolled to the bottom of the Reddit homepage I want the newest version to see if anything changed. A cache age of 0 seems correct from their end.

                This is where my opinion on back/forward navigation comes in again. As I said I think this is a fundamentally different action from making a new request/navigation to a site. I want to go back to what I had loaded just minutes ago. Making a new network request is a (sometimes inevitable (limited RAM/Disk cache)) failure from my browser. When I navigate back/forward and the browser does new network requests it's admitting that it failed to hold on to that tab's navigation history and it's doing the next best thing by loading the page again.

                So… I don't think this can be fixed on Reddit's end by changing their cache-control value without breaking the way caching works on that site for all normal browsing purposes. I think browsers should always attempt to keep a cache of all websites (only for back/forward navigation usage for the lifetime of the tab) despite any cache-control value that says otherwise.

                I agree with @pieterv regarding the intention of the user when clicking back or forward.

                It appears that the WebKit team also feels this way - or at least they did when their version of bfcache (Page Cache) was implemented over a decade ago: https://webkit.org/blog/427/webkit-page-cache-i-the-basics/

                Per the article, going back and forward instantly without reloading is the ideal UX.

                Vlad

                In this issue, we are talking about inter-page behavior. This is clearly the prerogative of the web browser, not the web standards (which are intended to relate to the initial loading of a page). It is the browsers responsibility to provide a functional and smooth user experience when navigating between pages - the HTTP headers shouldn’t get in the way of that. Furthermore, all browsers implement a bfcache of some sort because it is recognized that this provides a good UX. Safari doesn’t actually use it today because all sites are HTTPS, per the article above. This sounds like an opinion rather than necessity considering other browsers use bfcache on https sites without breaking the web.

                9 months later

                I would very much like to see the option (or default) for caching sites when going back. This is a pretty big frustration for me coming from Safari.

                It's especially frustrating when using sites that regenerate recomendations when returning from another page, in Safari I can resume browsing where I was at.

                • Vlad replied to this.

                  electronhater Not sure if that is related to this thread? And both Safari and Orion use WebKit and and should have same behavior when going back.

                    Vlad I might have mistaken what the thread is about. An example of what I'm experiencing: when using a site like Pixiv in Safari, if I select an artwork then go back a page, Safari renders the previously loaded version of page. In Orion going back always seems to re-request the previous page from the server.

                    In the case of Pixiv that means I can't return to the recomended works on the previous page since the reload fetches new suggested content from server.

                    • Vlad replied to this.

                      electronhater You wpuld probably need to start a new post for this and submit exact steps to reproduce (those aren't)

                        No one is typing