Version 1 (modified by Jon Davis, 4 years ago) (diff)


Back / Forward Cache

by Chris Dumez

  • Objectives
    • Make pages suspendable most of the time (~98%)
    • Allow for much faster back/forward navigation
    • Means addressing most failures to suspend, not introducing new ones
  • ActiveDOMObject
    • Largest cause of failures
    • Need to drop all shouldPreventEnteringBackForwardCache_DEPRECATED() overrides
    • Queue tasks on the event loop for running script (e.g. event dispatch, promise resolution)
    • Pause CPU-intensive work (e.g. animations) in suspend() and unpause it in resume()
    • Abort work that cannot be paused in suspend() and make sure tasks to dispatch relevant error events are queued on the event loop
  • Dedicated Workers
    • Dedicated workers have their whole thread suspended when entering the back/forward cache
    • ActiveDOMObject::suspend() / resume() do not get called
  • Service Workers
    • Service workers cannot be easily suspended because they can be shared
    • When a client page goes into the back/forward cache, it gets disconnected as a client of the service worker
    • When a service worker no longer has any clients, it is terminated