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

Enabling cache from UI #954

Merged
merged 1 commit into from
Dec 5, 2023

Conversation

kafkasl
Copy link
Contributor

@kafkasl kafkasl commented Nov 27, 2023

Description

Allowing the caching to be disabled from the uI again.

Details

URL to issue

N/A

Link to staging deployment URL (or set N/A)

https://ui-ahriman-ui60-api25.scp-staging.biomage.net/

Links to any PRs or resources related to this PR

Integration test branch

master

Merge checklist

Your changes will be ready for merging after all of the steps below have been completed.

Code updates

Have best practices and ongoing refactors being observed in this PR

  • Migrated any selector / reducer used to the new format.
  • All new dependency licenses have been checked for compatibility.

Manual/unit testing

  • Tested changes using InfraMock locally or no tests required for change, e.g. Kubernetes chart updates.
  • Validated that current unit tests for code work as expected and are sufficient for code coverage or no unit tests required for change, e.g. documentation update.
  • Unit tests written or no unit tests required for change, e.g. documentation update.

Integration testing

You must check the box below to run integration tests on the latest commit on your PR branch.
Integration tests have to pass before the PR can be merged. Without checking the box, your PR
will not pass the required status checks for merging.

  • Started end-to-end tests on the latest commit.

Documentation updates

  • Relevant Github READMEs updated or no GitHub README updates required.
  • Relevant Wiki pages created/updated or no Wiki updates required.

Optional

  • Staging environment is unstaged before merging.
  • Photo of a cute animal attached to this PR.

@kafkasl kafkasl added the safe to run Sensitive jobs are safe to be run label Nov 27, 2023
Copy link
Contributor

📦 Next.js Bundle Analysis for ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 568.79 KB (-48 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (085738c) 85.04% compared to head (f76ced7) 85.06%.

Files Patch % Lines
src/utils/work/dispatchWorkRequest.js 81.81% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #954      +/-   ##
==========================================
+ Coverage   85.04%   85.06%   +0.02%     
==========================================
  Files         548      548              
  Lines       10055    10063       +8     
  Branches     2183     2186       +3     
==========================================
+ Hits         8551     8560       +9     
+ Misses       1444     1443       -1     
  Partials       60       60              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines -71 to -75
const { environment } = getState().networkResources;
if (environment === Environment.DEVELOPMENT && !localStorage.getItem('disableCache')) {
localStorage.setItem('disableCache', 'true');
}

Copy link
Member

Choose a reason for hiding this comment

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

Removing these lines means that browser cache in the UI will always be enabled. Why are we making this change? This caching is different from the caching that is getting disabled in non-production environments in the API here: hms-dbmi-cellenics/api#511

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is that true? from my understanding, this localStorage.setItem('disableCache', 'true'); only stores a disableCache flag that is used to decide whether to send the cacheUniquenessKey to the API. No relation to the local storage in the browser.

Copy link
Member

Choose a reason for hiding this comment

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

What you are saying is true, but because the ETag was generated from the UI, this was effectively disabling the cache in local storage, hence the relation with local storage. Now that the ETag is computed from the API and hence for every request we reach to the API to get the ETag, it is true that the local storage cache of the UI can be disabled from the API. I find it weird, because the browser cache feels like something specific to the UI, hence it should be controlled by the UI. But I think it is ok as is, your changes as they are are good, I will approve shortly

@ivababukova ivababukova self-requested a review November 28, 2023 11:59
Copy link
Contributor

📦 Next.js Bundle Analysis for ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 568.79 KB (-48 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Copy link
Contributor

📦 Next.js Bundle Analysis for ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

🎉 Global Bundle Size Decreased

Page Size (compressed)
global 568.95 KB (-49 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/experiments/[experimentId]/data-processing 537.68 KB (🟡 +17 B) 1.08 MB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link
Contributor

github-actions bot commented Dec 4, 2023

📦 Next.js Bundle Analysis for ui

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 569.08 KB (🟡 +26 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

@kafkasl kafkasl changed the title chore: updated docs referring to caching Enabling cache from UI Dec 4, 2023
@kafkasl kafkasl merged commit 768ded5 into hms-dbmi-cellenics:master Dec 5, 2023
17 of 18 checks passed
@kafkasl kafkasl deleted the cache-disable branch December 5, 2023 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to run Sensitive jobs are safe to be run
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants