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

Increase response cache max-age for /schedules/{id} #10321

Open
xin-hedera opened this issue Feb 7, 2025 · 0 comments · May be fixed by #10383
Open

Increase response cache max-age for /schedules/{id} #10321

xin-hedera opened this issue Feb 7, 2025 · 0 comments · May be fixed by #10383
Labels
enhancement Type: New feature good first issue Good for newcomers rest Area: REST API

Comments

@xin-hedera
Copy link
Collaborator

xin-hedera commented Feb 7, 2025

Problem

/schedules/{id} is in among the most queried endpoints, the response cache header is set with the default 1 second max-age. This can cause a lot of unnecessary queries sent to the backend when the schedule has already finalized (either executed or expired).

In order to reduce the load, a much longer max-age (e.g., 1 hour) should be used instead.

Solution

Set a longer max-age for /schedules/{id} response if any of the following is true

  • deleted is true
  • executed_timestamp is not null
  • executed_timestamp is null, and one of the following is true
    • expiration_time is null and the wall clock time is at least 31 minutes after consensus_timestamp
    • expiration_time is not null and the wall clock time is at least 1 minute after expiration_time

Alternatives

No response

@xin-hedera xin-hedera added enhancement Type: New feature rest Area: REST API labels Feb 7, 2025
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Mirror Node Feb 10, 2025
@steven-sheehy steven-sheehy moved this from 📋 Backlog to 🏃‍♀ Sprint backlog in Mirror Node Feb 10, 2025
@steven-sheehy steven-sheehy added the good first issue Good for newcomers label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type: New feature good first issue Good for newcomers rest Area: REST API
Projects
Status: 🏃‍♀ Sprint backlog
2 participants