obsproject/obs-browser

Browser Cache Not Working

mafula1 opened this issue · 2 comments

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

29.1.3

OBS Studio Version (Other)

No response

OBS Studio Log URL

N/A

OBS Studio Crash Log URL

No response

Expected Behavior

With "Refresh Browser when scene becomes active" enabled, it should refresh the page without clearing the cache in Studio Mode, like it does with Studio Mode disabled.

Current Behavior

When using the "Refresh Browser when scene becomes active" in studio mode cache is seemingly cleared and all images need to be reloaded. It works as expected with Studio Mode disabled. Both the normal Http Cache as well as using Service Worker Cache fail.

Steps to Reproduce

  1. Create a Browser Source that contains larger images, with "Refresh Browser when scene becomes active" and "Shutdown when scene not visible" enabled.
  2. Create another, empty scene
  3. Without Studio Mode, the page is refreshed and all images are loaded instantly from cache
  4. With Studio Mode, this does not work

Anything else we should know?

Cache should not be cleared unless intended by the user. The "Refresh" button also seems to clear the cache (regardless of studio mode enabled or disabled). Perhaps an option can be added whether a "Refresh" should also clear the cache, but either way, the behaviour of the options should be consistent with Studio Mode enabled or disabled.

This is currently intentional. The goal is that when data in refreshed in a browser source, all data should be refreshed.

cefBrowser->ReloadIgnoreCache();

You should be using other methods of reloading data in your page rather than a full page reload.

It seems I can get the desired effect by using the "obsSourceActiveChanged" event.