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

Bug: Caching issues when following initial instruction #20

Open
ValeriyMaslenikov opened this issue Sep 4, 2023 · 0 comments
Open

Bug: Caching issues when following initial instruction #20

ValeriyMaslenikov opened this issue Sep 4, 2023 · 0 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@ValeriyMaslenikov
Copy link
Collaborator

ValeriyMaslenikov commented Sep 4, 2023

Based on the example provided I've tried to install library with the following steps:

  1. Added the Joystick client in the ConfigureServices:
// Joystick
builder.Services.AddJoystickClient();
builder.Services.AddOptions<JoystickClientConfig>()
    .Bind(builder.Configuration.GetSection("JoystickConfig"));

And added appropriate configuration to appsettings.json:

{
  "JoystickConfig": {
      "ApiKey": "...",
      "CacheOptions": {
          "CacheExpirationSeconds": 600
      }
  }
}
  1. Added client code for the controller (for test purposes);
        var fullContent = await client.GetFullContentAsync(configName);
        var fullContent2 = await client.GetFullContentAsync(configName);
        var fullContent3 = await client.GetFullContentAsync(configName);
        var fullContent4 = await client.GetFullContentAsync(configName);
        var fullContent5 = await client.GetFullContentAsync(configName);
  1. Triggered new API endpoint with Postman perf test.

Every additional copy-pasted line drastically increases the response time of the specified API call.

Graph of response times over time for version where there's 1 call to Joystick library to get the same config:
image

Graph of response times over time for version where there're 5 calls to Joystick:
image

Sounds like the problem is related to cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants