Skip to content

[WPE] don't put page with multimedia to bfCache on low-end devices#1698

Open
pgorszkowski-igalia wants to merge 1 commit into
wpe-2.38from
pgorszkowski/2.38/WPE-don-t-put-page-with-multimedia-to-bfCache-on-low-end-devices
Open

[WPE] don't put page with multimedia to bfCache on low-end devices#1698
pgorszkowski-igalia wants to merge 1 commit into
wpe-2.38from
pgorszkowski/2.38/WPE-don-t-put-page-with-multimedia-to-bfCache-on-low-end-devices

Conversation

@pgorszkowski-igalia

@pgorszkowski-igalia pgorszkowski-igalia commented Jul 10, 2026

Copy link
Copy Markdown

https://bugs.webkit.org/show_bug.cgi?id=318851

Reviewed by Alicia Boya Garcia.

Add a new WPE-only feature BackForwardCacheWithMediaEnabled that allows applications to control whether pages containing audio or video elements can be placed in the back/forward cache.

When disabled, pages with media elements are excluded from the back/forward cache. This is particularly useful on low-end embedded devices with a limited number of hardware decoders, where keeping a suspended media pipeline alive in the cache may prevent other pages from acquiring the decoder.

The feature is enabled by default (preserving existing behavior).

Two new WPE layout tests verify the behavior:

  • page-cache-video-media-disabled.html: verifies pages with media are not cached when the feature is disabled.
  • page-cache-video-media-enabled.html: verifies pages with media can enter and be restored from the back/forward cache when the feature is enabled.

Tests: platform/wpe/fast/history/page-cache-video-media-disabled.html
platform/wpe/fast/history/page-cache-video-media-enabled.html

  • LayoutTests/platform/wpe/fast/history/page-cache-video-media-disabled-expected.txt: Added.
  • LayoutTests/platform/wpe/fast/history/page-cache-video-media-disabled.html: Added.
  • LayoutTests/platform/wpe/fast/history/page-cache-video-media-enabled-expected.txt: Added.
  • LayoutTests/platform/wpe/fast/history/page-cache-video-media-enabled.html: Added.
  • LayoutTests/platform/wpe/fast/history/resources/page-cache-helper.html: Added.
  • Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
  • Source/WebCore/history/BackForwardCache.cpp: (WebCore::canCachePage):

Canonical link: https://commits.webkit.org/316840@main
5cf00fe

Build-Tests Layout-Tests
✅ 🛠 wpe-238-amd64-build ✅ 🧪 wpe-238-amd64-layout
✅ 🛠 wpe-238-arm32-build ✅ 🧪 wpe-238-arm32-layout

https://bugs.webkit.org/show_bug.cgi?id=318851

Reviewed by Alicia Boya Garcia.

Add a new WPE-only feature `BackForwardCacheWithMediaEnabled` that allows
applications to control whether pages containing audio or video elements
can be placed in the back/forward cache.

When disabled, pages with media elements are excluded from the back/forward
cache. This is particularly useful on low-end embedded devices with a limited
number of hardware decoders, where keeping a suspended media pipeline alive in
the cache may prevent other pages from acquiring the decoder.

The feature is enabled by default (preserving existing behavior).

Two new WPE layout tests verify the behavior:
- page-cache-video-media-disabled.html: verifies pages with media are not
  cached when the feature is disabled.
- page-cache-video-media-enabled.html: verifies pages with media can enter
  and be restored from the back/forward cache when the feature is enabled.

Tests: platform/wpe/fast/history/page-cache-video-media-disabled.html
       platform/wpe/fast/history/page-cache-video-media-enabled.html
* LayoutTests/platform/wpe/fast/history/page-cache-video-media-disabled-expected.txt: Added.
* LayoutTests/platform/wpe/fast/history/page-cache-video-media-disabled.html: Added.
* LayoutTests/platform/wpe/fast/history/page-cache-video-media-enabled-expected.txt: Added.
* LayoutTests/platform/wpe/fast/history/page-cache-video-media-enabled.html: Added.
* LayoutTests/platform/wpe/fast/history/resources/page-cache-helper.html: Added.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/history/BackForwardCache.cpp:
(WebCore::canCachePage):

Canonical link: https://commits.webkit.org/316840@main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant