Skip to content
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

Use cacheable lists where possible #1661

Merged
merged 7 commits into from
Jul 2, 2023

Conversation

ghys
Copy link
Member

@ghys ghys commented Jan 24, 2023

Depends on openhab/openhab-core#3335.

Will fetch items, things and rules with the cacheable parameter set
when appropriate.

Closes #1650.

Signed-off-by: Yannick Schaus [email protected]

@ghys ghys requested review from kaikreuzer and a team as code owners January 24, 2023 10:36
Depends on openhab/openhab-core#3335.

Will fetch items, things and rules with the `cacheable` parameter set
when appropriate.

Closes openhab#1650.

Signed-off-by: Yannick Schaus <[email protected]>
@ghys ghys force-pushed the use-cacheable-lists branch from bc18fe4 to 6926c1c Compare January 24, 2023 10:39
@relativeci
Copy link

relativeci bot commented Jan 24, 2023

Job #1051: Bundle Size — 15.74MiB (~-0.01%).

d36f410(current) vs 7f0bd4d main#1050(baseline)

⚠️ Bundle contains 16 duplicate packages

Metrics (1 change)
                 Current
Job #1051
     Baseline
Job #1050
Initial JS 1.67MiB(~+0.01%) 1.67MiB
Initial CSS 608.89KiB 608.89KiB
Cache Invalidation 93.94% 93.94%
Chunks 219 219
Assets 689 689
Modules 1700 1700
Duplicate Modules 90 90
Duplicate Code 1.95% 1.95%
Packages 138 138
Duplicate Packages 15 15
Total size by type (2 changes)
                 Current
Job #1051
     Baseline
Job #1050
CSS 859.34KiB 859.34KiB
Fonts 526.1KiB 526.1KiB
HTML 1.23KiB 1.23KiB
IMG 140.74KiB 140.74KiB
JS 9.24MiB (~+0.01%) 9.24MiB
Media 295.6KiB 295.6KiB
Other 4.72MiB (~-0.01%) 4.72MiB

View job #1051 reportView main branch activity

Signed-off-by: Yannick Schaus <[email protected]>
@florian-h05
Copy link
Contributor

@ghys Would this solve issue #673?

@ghys
Copy link
Member Author

ghys commented Feb 9, 2023

I don't think so - the problem was likely mitigated by the added ?summary=true parameter and by #675. Some people have a lot of status changes (multiple times a second in some cases) and there's not much more to do to address that.

@florian-h05
Copy link
Contributor

@ghys Can you please Update is PR and resolve merge conflicts?

@ghys
Copy link
Member Author

ghys commented Jul 2, 2023

done, should be good now!

Signed-off-by: Florian Hotze <[email protected]>
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!
This should really improve load times on any network!

You had a typo somewhere, I corrected it and also extended usage of staticDataOnly to a few other requests you forgot.

@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels Jul 2, 2023
@florian-h05 florian-h05 added this to the 4.0 milestone Jul 2, 2023
@florian-h05 florian-h05 merged commit 1257a0d into openhab:main Jul 2, 2023
@ghys
Copy link
Member Author

ghys commented Jul 2, 2023

You had a typo somewhere

Of course I had, much appreciated! 😓

extended usage of staticDataOnly

About those on the developer sidebar search, I didn't change them because maybe the non-static data from those requests are actually useful (it shows the state of items and status of things & rules etc.). We'll see if it breaks something.

@florian-h05
Copy link
Contributor

About those on the developer sidebar search, I didn't change them because maybe the non-static data from those requests are actually useful.

I have checked, the search does not use anything from the non-static data.
Regarding status, I think those come from SSE, so I'd don't expect any problems but we'll see.

@florian-h05 florian-h05 changed the title Use cacheable lists when possible Use cacheable lists where possible Jul 2, 2023
@florian-h05
Copy link
Contributor

I just noticed that we forgot the UI endpoints, which also support staticDataOnly.

florian-h05 added a commit to florian-h05/openhab-webui that referenced this pull request Jul 24, 2023
Regression from openhab#1661.

Using the cacheable list for Things leads to a failure because the status field is not available then.

Signed-off-by: Florian Hotze <[email protected]>
ghys pushed a commit that referenced this pull request Jul 26, 2023
Regression from #1661.

Using the cacheable list for Things leads to a failure because the
status field is not available then.
This reverts the change from #1661 to this single REST request.

Signed-off-by: Florian Hotze <[email protected]>
florian-h05 added a commit that referenced this pull request Jul 26, 2023
Regression from #1661.

Using the cacheable list for Things leads to a failure because the
status field is not available then.
This reverts the change from #1661 to this single REST request.

Signed-off-by: Florian Hotze <[email protected]>
(cherry picked from commit efa3345)
florian-h05 pushed a commit that referenced this pull request Aug 18, 2023
Fixes #1996.
Regression from #1661.

Supersedes openhab/openhab-core#3761.

Signed-off-by: Yannick Schaus <[email protected]>
florian-h05 pushed a commit that referenced this pull request Aug 19, 2023
Fixes #1996.
Regression from #1661.

Supersedes openhab/openhab-core#3761.

Signed-off-by: Yannick Schaus <[email protected]>
(cherry picked from commit 3eff1fa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MainUI] /settings/things/<thing uid> requests entire things JSON from API
2 participants