Skip to content

Bug: Caching issues when following initial instruction #20

Open
@ValeriyMaslenikov

Description

@ValeriyMaslenikov

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.

Metadata

Metadata

Assignees

Labels

🐛 bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions