Skip to content

fix: [UI] Add version check cache avoid exhaust Github API rate limit#4932

Open
roj234 wants to merge 3 commits intoLizardByte:masterfrom
roj234:ui-fix
Open

fix: [UI] Add version check cache avoid exhaust Github API rate limit#4932
roj234 wants to merge 3 commits intoLizardByte:masterfrom
roj234:ui-fix

Conversation

@roj234
Copy link
Copy Markdown

@roj234 roj234 commented Mar 31, 2026

Description

Each time I refresh Sunshine page, It will request Github API twice, and Github API (no api key) have a one-hour limit, which shared with many other projects.
This PR have added an 1 day cache, so that Sunshine UI only request Github API once per day.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

roj234 added 2 commits April 1, 2026 00:03
Add caching for version data to reduce API calls.
@roj234 roj234 changed the title [UI] Add 1 day version cache avoid exhaust Github API rate limit fix: [UI] Add 1 day version cache avoid exhaust Github API rate limit Mar 31, 2026
@ReenigneArcher
Copy link
Copy Markdown
Member

I'm not sure about caching for a whole day. The limit is 60 requests per hour for unauthenticated requests. I think a 1 hour cache would be okay though so we don't consume more than 2 per hour.

@roj234 roj234 changed the title fix: [UI] Add 1 day version cache avoid exhaust Github API rate limit fix: [UI] Add version check cache avoid exhaust Github API rate limit Apr 2, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue
1 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@roj234
Copy link
Copy Markdown
Author

roj234 commented Apr 4, 2026

I'm not sure about caching for a whole day. The limit is 60 requests per hour for unauthenticated requests. I think a 1 hour cache would be okay though so we don't consume more than 2 per hour.

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants