New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance: back/forward cache disabled with an open IndexedDB connection in Chromium #996
Comments
Hi, I have been able to reproduce the Lighthouse diagnostic in Chrome 112 (it was not here in previous versions). Could you investigate if this is a Chrome-specific behavior? While disabling back/forward cache if an IndexedDB transaction is still opened makes sense, it is quite weird to disable it if a connection is still open, which is a very common and intended behavior. The Chrome documentation itself is ambiguous, as it first tells there can be issues if "in the middle of an IndexedDB transaction", and then later in the article it tells there can be issues "with an open IndexedDB connection". Firefox documentation says cache is disabled if "the page has running IndexedDB transactions". Found nothing about indexedDb in Safari documentation. Could you find a way to check the behavior of Firefox and Safari? |
Same is the case with Edge, in bfcache issue on lighthouse repository GoogleChrome/lighthouse#13960 As per the list:
I am not sure if this list is about all browsers. There's some discussion on the topic in Firebase repo as well firebase/firebase-js-sdk#6167 *Adding links for reference. |
Edge is based on Chromium so that was expected. I've done some testing, and like the discussion in the Firebase thread you mentioned suggested, it is a big mess. First, without any IndexedDB (or anything else that could disabled the back/forward cache):
Second, with IndexedDB opened:
So it is a non-standard Chromium behavior, and globally the implementation is buggy, so I am not sure the library will be able to fix this. If anyone wants to investigate, be sure to launch your Angular project with |
Thank you so much @cyrilletuzi for your time and looking into this and sharing your findings. Yes I agree, but I am surprised that if its inconsistent across browsers, why have the Lighthouse team included it in latest version? I have one question, can you please share what impact does the below workaround have on Angular app, when using this plugin:
|
Lighthouse is a part of Google Chrome, and its tests are opinionated. It could be an idea to report an issue in the Lighthouse repo to ask their reasoning, and what would be a cross-browser compatible solution.
A
|
Checks before posting an issue
Configuration
@ngx-pwa/local-storage
version:ng version
):Description of the issue
As described in https://web.dev/bfcache, the browsers' back/forward cache doesn't work when IndexedDB has an open connection. It seems that in current implementation the connections are opened but they're never closed. Here when running a Lighthouse audit for an Angular app, there's an error
The documentation of back/forward cache: https://developer.chrome.com/docs/lighthouse/performance/bf-cache/
How to reproduce the issue
Running a Lighthouse audit for an Angular app using latest version (I am testing it on Version 112.0.5615.87 (Official Build) (64-bit)) of Chrome, should throw this error.
The text was updated successfully, but these errors were encountered: