Learn Time: Experiments with cache in-Memory.
The main goal of this experiment is to demonstrate how using in-memory caching
can improve performance and efficiency when loading a list of board games. The experiment
will fetch data from an external data source consisting of a list of board games,
including information such as game id, name and Ludopedia link. By implementing an in-memory
caching system, my intention is to speed up access to this data, minimizing query time and
increasing API responsiveness.
- C#
- XUnit
- Stryker Mutator
- Integration with an external data source
- Cache in-memory in ASP.NET Core
- User-Secrets
- HttpClient Factory
- Ludopedia API Docs
- Increase test code coverage
The project requires .NET 6.0.
Tested on:
- Rider 2023.2.2
From the terminal/shell/command line tool, use the following commands to build, test and run the API.
- Enable User-Secrets
# From the MemoryCache.Labs.API root
dotnet user-secrets init
# To generate a secret read the ludopedia API docs above.
dotnet user-secrets set "LUDOPEDIA_SECRET" "xyz@123#456"
dotnet build
# Note: During my experiments ( March, 2023 ) the .NET7 had issues to execute this command.
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura
# Install the ReportGenerator
dotnet tool install -g dotnet-reportgenerator-globaltool
# Generate reports
reportgenerator -reports:"**/**/coverage.cobertura.xml" -targetdir:"coveragereport" -reporttypes:Html