TILT-Server Timing in Browser-part 19
For see fast what is happening with your server, you can use the Server Timing API.
One of the implementations for .NET is https://github.com/tpeczek/Lib.AspNetCore.ServerTiming .
Not a big deal – implemented separately with AOPMethodsCommon – but I think it is a good idea to use it.
The implementation was straightforward
builder.Services.AddScoped<ServerTiming>(); var app = builder.Build(); app.UseServerTiming();
And then use DI to get the instance of the class.
With this occasion , look how is different calling same method twice
vs
If you do not realize, there are 50 ms vs 1 ms . That difference is from caching
private async Task<TILT_Note_Table[]?> privateLatestTILTs(string urlPart, int numberTILTS) { if (cache.TryGetValue<TILT_Note_Table[]>(urlPart, out var result)) { return result; } //code }
Nice, right ? See the timing right in your browser.
Leave a Reply